using IronIntel.Contractor.Site; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Jump : ContractorBasePage { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Title = PageTitle; var session = GetCurrentLoginSession(); if (session == null) { Response.Redirect(LoginPageUrl + "?f=" + HttpUtility.UrlEncode(Request.Url.ToString()), true); } else { //byte[] buf = Encoding.UTF8.GetBytes(s); //return Convert.ToBase64String(tmp); string p = Request.Params["p"];//jt=woe;woid=3 try { byte[] tmp = Convert.FromBase64String(p); p = Encoding.UTF8.GetString(tmp); } catch { } Dictionary ps = GetParams(p); string jumpType = ""; if (ps.ContainsKey("jt")) jumpType = ps["jt"].ToUpper(); switch (jumpType) { case "WOE"://Work Order Edit JumpToWorkOrder(ps); break; } } } } /// /// 解析跳转相关参数 /// /// /// private Dictionary GetParams(string s) { Dictionary ps = new Dictionary(StringComparer.OrdinalIgnoreCase); if (!string.IsNullOrEmpty(s)) { string[] kvs = s.Split(';'); foreach (string kv in kvs) { string[] temp = kv.Split('='); if (temp.Length == 2) { ps[temp[0]] = temp[1]; } } } return ps; } private void JumpToWorkOrder(Dictionary ps) { string woid = ""; if (ps.ContainsKey("woid")) woid = ps["woid"]; Response.Redirect("Maintenance/AddWorkOrder.aspx?woid=" + woid, true); } }