<%@ WebHandler Language="C#" Class="Kernel" %> using System; using System.Collections.Generic; using System.Web; using System.Data; using System.Data.Common; using System.Web.SessionState; using System.Text; using eMIS; public class Kernel : IHttpHandler , IRequiresSessionState { public void ProcessRequest (HttpContext context) { if (context.Session["userid"]==null) context.Response.End(); string userId = context.Session["userid"].ToString(); string programId = context.Request.QueryString["pid"].ToString(); string conditions; if (context.Request.QueryString["c"] != null) { conditions = context.Request.QueryString["c"].ToString(); } else { conditions = context.Request.QueryString["cond"].ToString(); conditions = DataManager.Decrypt(conditions); } string buttonGroupID = context.Request.QueryString["t"].ToString(); string randpara = DateTime.Now.Ticks.ToString(); string parentProgramId = context.Request.QueryString["ppid"].ToString(); //string vr = context.Request.QueryString["vr"].ToString(); string vr = context.Request.QueryString["cpara"].ToString(); vr = DataManager.UrlDecode(vr); string flowNode = context.Request.QueryString["f"] == null ? "" : context.Request.QueryString["f"].ToString(); InstanceManager inst = new InstanceManager(context); inst.MenuID = parentProgramId; string popedomUserId = inst.PopedomUserID; inst = new InstanceManager(context,programId); string menu_para_id = programId;// DataManager.Encrypt(programId + ".d"); //inst.StateKey = "sub"; //inst.StateKey = "d"; inst.InitState(); inst.ParentID = parentProgramId; if (flowNode != "") { inst.FlowNode = flowNode; inst.FlowNodePopedom = flowNode; FieldPopedomManager fieldPopedomManager = new FieldPopedomManager(inst); DataRow[] rows = fieldPopedomManager.Flow_Popedom_Table.Select("CXID=" + programId + " and KJID=-3"); if (rows.Length == 0 || rows[0]["QX"].ToString() == "-1") { if (!fieldPopedomManager.ProgramPermission(inst.ProgramID).Update) { buttonGroupID = "1"; } } else { switch (rows[0]["QX"].ToString()) { case "0": buttonGroupID = "1"; break; case "1": buttonGroupID = "2"; break; case "2": buttonGroupID = "3"; break; case "3": buttonGroupID = "4"; break; case "4": buttonGroupID = "5"; break; case "5": break; } } } inst.FlowNode = ""; inst.AllowSaveState = true; //2015年1月16日注释,解决flownode丢失问题,20日发现有的从表datashow查询不到记录 //inst.QueryCondition = ""; inst.DefaultCondition = conditions; //context.Response.Write("1"); //context.Response.End(); inst.ButtonGroupID = buttonGroupID; inst.SqlOrder = inst.Program.Properties["MRPX"].ToString(); inst.PopedomUserID = popedomUserId; inst.FlowNodePopedom = flowNode; string tree = inst.Program.Properties["tree"].ToString(); string url=""; if (context.Request.QueryString["fk"] != null && context.Request.QueryString["fk"].ToString() != "") { inst.SetStateValue("fk", context.Request.QueryString["fk"].ToString()); inst.SetStateValue("fkv", context.Request.QueryString["fkv"].ToString()); string page = (context.Request.QueryString["page"] == null ? "" : context.Request.QueryString["page"].ToString()); if (context.Request.QueryString["mini"] != null) inst.SetStateValue("mini",context.Request.QueryString["mini"].ToString()); //inst.FlowNode = nodeName; //inst.SqlOrder = program.Properties["MRPX"].ToString(); vr += ";fk:"+context.Request.QueryString["fk"].ToString()+";fkv:"+context.Request.QueryString["fkv"].ToString()+";"; inst.SetStateValue("vr", vr); url = "Data_Show.ashx?r=" + randpara + "&proid=" + menu_para_id; if(tree!="") url = "TreeListFrame.aspx?pid=" + menu_para_id + "&tjson=" + eMIS.Utility.JsSecurity.EncryptByAES(tree) + "&r=" + randpara; if (page != "") { inst.SetStateValue("emn", "1"); inst.ButtonGroupID = "2"; if (flowNode != "") { FieldPopedomManager fieldPopedomManager = new FieldPopedomManager(inst); //inst.Readonly = fieldPopedomManager.SubProgrameReadonly() == 1; inst.Readonly = !fieldPopedomManager.ProgramPermission(inst.ProgramID).Update; } string ip = HttpContext.Current.Request.UserHostAddress; string url_dt = DateTime.Now.Ticks.ToString(); string token = DataManager.GetToken(userId, url_dt, ip); url = "EditData.ashx?varSign=" + inst.GetFirstRecordPrimaryKeyValue() + "&token=" + token + "&proid=" + menu_para_id + "&r=" + randpara; } } else { inst.SetStateValue("emn","1"); inst.DefaultCondition = ""; url = "EditData.ashx?proid="+menu_para_id+"&varSign="+context.Request.QueryString["fkv"].ToString()+"&r="+randpara; } context.Response.Redirect(url); } public bool IsReusable { get { return false; } } }