%@ WebHandler Language="C#" Class="EditData" %> 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 EditData : IHttpHandler , IRequiresSessionState { public void ProcessRequest (HttpContext context) { if (context.Session["userid"] == null) { LoginManager lm = new LoginManager(context); if (!lm.VerifyIdentity()) { context.Response.Write("会话丢失,请重新登陆!"); context.Response.End(); } } string wwwroot = context.Request.ApplicationPath; if (wwwroot == "/") wwwroot = ""; string themePath = wwwroot + "/Themes/" + context.Session["Theme"].ToString(); string menuId = context.Request["proid"].ToString(); string recordId = context.Request["varSign"].ToString(); string recordId2 = (context.Request["mrid"] == null ? "" : context.Request["mrid"].ToString()); bool isIP = (context.Session["ismobile"].ToString() == "1"); int i; string userId = context.Session["userid"].ToString(); string userCnName = context.Session["usercnname"].ToString(); string rndstr = DateTime.Now.ToString(); bool multiRowEdit = false; DataManager dm = new DataManager(); InstanceManager inst = new InstanceManager(context, dm, menuId); inst.PrimaryKeyValue = recordId; string popedomUserId = inst.PopedomUserID; if (recordId2 != "") { multiRowEdit = true; inst.MultiRowEditPrimaryKey = recordId2; } if (recordId =="" && context.Request["position"] != null) { inst.RecordPosition = int.Parse(context.Request["position"].ToString()); recordId = inst.PrimaryKeyValue; if (recordId == null) recordId = ""; } string mini = inst.GetStateValue("emn"); bool allowEdit = true; if (mini == "") { allowEdit = inst.AllowEdit(); } else { inst.FieldPopedom.Priority = 2; } if (!allowEdit) { context.Response.Write("没有访问的权限!"); context.Response.End(); } string s; //set pri = aco.GetPrivilegeObject() //pri.init aco.sysconn,proid,2 //'if not pri.Permission(session("renyuan_id")) then '验证有没有编辑的权限 //' s = "false" //'end if //if s = "" and recid <> "" and aco.ParentValue="" then '验证有没有访问该记录的权限 // s = pri.GetListCondition(session("renyuan_id")) // if s <> "" then // aco.openuc() // set rs = aco.getrs("select count(" & aco.mt.gjzd & ") from " & aco.mt.fwb & " where " & aco.mt.gjzd & "=" & recid & s,0) // if rs(0) = 0 then // s = "false" // end if // aco.closeuc // end if //end if //if s = "false" then //aco.closesc //set aco = nothing //response.redirect "Error_Display.asp?ReturnUrl=0&Error_Text=" & server.urlencode("没有权限打开该页面!") //end if ProgramManager program = inst.Program; DataTable elements = program.EditElements; int elementsCount = elements.Rows.Count; FieldPopedomManager fpm = new FieldPopedomManager(inst); string programId = program.ID; string customUi =(multiRowEdit ? "" : program.Properties["DZBJYM"].ToString()); bool isTab = (inst.Program.EditPageTabName != ""); if (elementsCount == 0) { string path = customUi; if (path == "") { context.Response.Redirect("Error_Display.asp?ReturnUrl=0&Error_Text=" + context.Server.UrlEncode("请定义维护字段!")); } else { path = program.GetTemplatePath(path); if (path.IndexOf("?") == -1) path += "?"; else path += "&"; } context.Response.Redirect(wwwroot + path + "id=" + recordId + "&proid=" + menuId + "&position=" + inst.RecordPosition.ToString() + "&count=" + inst.RecordCount.ToString() + "&recid=" + recordId); } string pagetitle = program.Properties["bt"].ToString(); StringBuilder sb = new StringBuilder(); sb.AppendLine(""); sb.AppendLine("
"); sb.AppendLine("