protected void Page_Load(object sender, EventArgs e) { if (Session["User"] == null) { Response.Redirect("../Login.aspx"); Response.End(); } string B_Company_id = Request["B_Company_id"]; if (string.IsNullOrEmpty(B_Company_id)) { m_Company = Global.GetCtx(Session["TopCompany"].ToString()).CompanyMgr.FindTopCompany(); } else { m_Company = (CCompany)Global.GetCtx(Session["TopCompany"].ToString()).CompanyMgr.Find(new Guid(B_Company_id)); } m_Table = m_Company.WorkflowCatalogMgr.Table; string id = Request["id"]; if (string.IsNullOrEmpty(id)) { Response.Write("请选择记录!"); Response.End(); } m_BaseObject = m_Company.WorkflowCatalogMgr.Find(new Guid(id)); if (m_BaseObject == null) { Response.Write("请选择记录!"); Response.End(); } //保存到编辑对象 EditObject.Add(Session.SessionID, m_BaseObject); if (Request.Params["Action"] == "Cancel") { m_BaseObject.Cancel(); Response.End(); } else if (Request.Params["Action"] == "PostData") { PostData(); //从编辑对象移除 EditObject.Remove(Session.SessionID, m_BaseObject); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { string tid = Request["tid"]; if (string.IsNullOrEmpty(tid)) { Response.Write("请选择表!"); Response.End(); } m_Table = (CTable)Global.GetCtx(Session["TopCompany"].ToString()).TableMgr.Find(new Guid(tid)); string id = Request["id"]; if (string.IsNullOrEmpty(id)) { Response.Write("请选择记录!"); Response.End(); } string ParentId = Request["ParentId"]; if (!string.IsNullOrEmpty(ParentId)) { m_guidParentId = new Guid(ParentId); } m_BaseObjectMgr = Global.GetCtx(Session["TopCompany"].ToString()).FindBaseObjectMgrCache(m_Table.Code, m_guidParentId); if (m_BaseObjectMgr == null) { m_BaseObjectMgr = new CBaseObjectMgr(); m_BaseObjectMgr.TbCode = m_Table.Code; m_BaseObjectMgr.Ctx = Global.GetCtx(Session["TopCompany"].ToString()); string sWhere = string.Format(" id='{0}'", id); m_BaseObjectMgr.GetList(sWhere); } m_BaseObject = m_BaseObjectMgr.Find(new Guid(id)); if (m_BaseObject == null) { Response.Write("请选择记录!"); Response.End(); } //保存到编辑对象 EditObject.Add(Session.SessionID, m_BaseObject); if (!IsPostBack) { recordCtrl.m_Table = m_Table; //recordCtrl.m_sortRestrictColumnAccessType = m_sortRestrictColumnAccessType; recordCtrl.m_BaseObject = m_BaseObject; } if (Request.Params["Action"] == "Cancel") { m_BaseObject.Cancel(); Response.End(); } else if (Request.Params["Action"] == "PostData") { PostData(); //从编辑对象移除 EditObject.Remove(Session.SessionID, m_BaseObject); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["User"] == null) { Response.Redirect("../Login.aspx"); Response.End(); } string B_Company_id = Request["B_Company_id"]; if (string.IsNullOrEmpty(B_Company_id)) { m_Company = Global.GetCtx(Session["TopCompany"].ToString()).CompanyMgr.FindTopCompany(); } else { m_Company = (CCompany)Global.GetCtx(Session["TopCompany"].ToString()).CompanyMgr.Find(new Guid(B_Company_id)); } string wfid = Request["wfid"]; if (string.IsNullOrEmpty(wfid)) { Response.End(); return; } m_WorkflowDef = (CWorkflowDef)m_Company.WorkflowDefMgr.Find(new Guid(wfid)); if (m_WorkflowDef == null) //可能是新建的 { if (Session["AddWorkflowDef"] == null) { Response.End(); return; } m_WorkflowDef = (CWorkflowDef)Session["AddWorkflowDef"]; } m_ActivesDefMgr = (CActivesDefMgr)m_WorkflowDef.ActivesDefMgr; string id = Request["id"]; if (string.IsNullOrEmpty(id)) { Response.End(); return; } m_BaseObject = m_ActivesDefMgr.Find(new Guid(id)); if (m_BaseObject == null) { Response.End(); return; } m_Table = m_ActivesDefMgr.Table; if (Request.Params["Action"] == "Cancel") { m_BaseObject.Cancel(); Response.End(); } else if (Request.Params["Action"] == "PostData") { PostData(); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["User"] == null) { Response.End(); } m_User = (CUser)Session["User"]; string vid = Request["vid"]; if (string.IsNullOrEmpty(vid)) { Response.End(); } m_View = (CView)Global.GetCtx(Session["TopCompany"].ToString()).ViewMgr.Find(new Guid(vid)); if (m_View == null) { Response.End(); } m_Table = (CTable)Global.GetCtx(Session["TopCompany"].ToString()).TableMgr.Find(m_View.FW_Table_id); //检查权限 if (!CheckAccess()) { Response.End(); } string ParentId = Request["ParentId"]; if (!string.IsNullOrEmpty(ParentId)) { m_guidParentId = new Guid(ParentId); } string id = Request["id"]; if (string.IsNullOrEmpty(id)) { Response.Write("请选择记录!"); Response.End(); } if (Session["EditMultMasterDetailViewRecord"] != null) { SortedList <Guid, CBaseObject> arrP = (SortedList <Guid, CBaseObject>)Session["EditMultMasterDetailViewRecord"]; CBaseObject objP = (CBaseObject)arrP.Values[0]; if (objP.Id.ToString() != id) { Session["EditMultMasterDetailViewRecord"] = null; } } if (Session["EditMultMasterDetailViewRecord"] == null) { CBaseObjectMgr BaseObjectMgr = Global.GetCtx(Session["TopCompany"].ToString()).FindBaseObjectMgrCache(m_Table.Code, m_guidParentId); if (BaseObjectMgr == null) { BaseObjectMgr = new CBaseObjectMgr(); BaseObjectMgr.TbCode = m_Table.Code; BaseObjectMgr.Ctx = Global.GetCtx(Session["TopCompany"].ToString()); string sWhere = string.Format(" id='{0}'", id); BaseObjectMgr.GetList(sWhere); } CBaseObject obj = BaseObjectMgr.Find(new Guid(id)); if (obj == null) { Response.Write("请选择记录!"); Response.End(); } SortedList <Guid, CBaseObject> arrP = new SortedList <Guid, CBaseObject>(); arrP.Add(obj.Id, obj); Session["EditMultMasterDetailViewRecord"] = arrP; } SortedList <Guid, CBaseObject> arrP2 = (SortedList <Guid, CBaseObject>)Session["EditMultMasterDetailViewRecord"]; m_BaseObject = (CBaseObject)arrP2.Values[0]; //保存到编辑对象 EditObject.Add(Session.SessionID, m_BaseObject); if (!IsPostBack) { recordCtrl.m_View = m_View; recordCtrl.m_Table = m_Table; recordCtrl.m_sortRestrictColumnAccessType = m_sortRestrictColumnAccessType; recordCtrl.m_BaseObject = m_BaseObject; if (!string.IsNullOrEmpty(Request["UIColCount"])) { recordCtrl.m_iUIColCount = Convert.ToInt32(Request["UIColCount"]); } //隐藏字段 string sHideCols = Request["HideCols"]; if (!string.IsNullOrEmpty(sHideCols)) { string[] arr = sHideCols.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); foreach (string code in arr) { recordCtrl.m_sortHideColumn.Add(code, code); } } } if (Request.Params["Action"] == "Cancel") { Session["EditMultMasterDetailViewRecord"] = null; m_BaseObject.Cancel(); //从编辑对象移除 EditObject.Remove(Session.SessionID, m_BaseObject); Response.End(); } else if (Request.Params["Action"] == "PostData") { PostData(); //从编辑对象移除 EditObject.Remove(Session.SessionID, m_BaseObject); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["User"] == null) { Response.End(); } m_User = (CUser)Session["User"]; string vid = Request["vid"]; if (string.IsNullOrEmpty(vid)) { Response.End(); } m_View = (CView)Global.GetCtx(Session["TopCompany"].ToString()).ViewMgr.Find(new Guid(vid)); if (m_View == null) { Response.End(); } m_Table = (CTable)Global.GetCtx(Session["TopCompany"].ToString()).TableMgr.Find(m_View.FW_Table_id); //检查权限 if (!CheckAccess()) { Response.End(); } string ParentId = Request["ParentId"]; if (!string.IsNullOrEmpty(ParentId)) { m_guidParentId = new Guid(ParentId); } string id = Request["id"]; if (string.IsNullOrEmpty(id)) { Response.Write("请选择记录!"); Response.End(); } m_BaseObjectMgr = Global.GetCtx(Session["TopCompany"].ToString()).FindBaseObjectMgrCache(m_Table.Code, m_guidParentId); if (m_BaseObjectMgr == null) { m_BaseObjectMgr = new CBaseObjectMgr(); m_BaseObjectMgr.TbCode = m_Table.Code; m_BaseObjectMgr.Ctx = Global.GetCtx(Session["TopCompany"].ToString()); string sWhere = string.Format(" id='{0}'", id); m_BaseObjectMgr.GetList(sWhere); } m_BaseObject = m_BaseObjectMgr.Find(new Guid(id)); if (m_BaseObject == null) { Response.Write("请选择记录!"); Response.End(); } //保存到编辑对象 EditObject.Add(Session.SessionID, m_BaseObject); if (!IsPostBack) { recordCtrl.m_View = m_View; recordCtrl.m_Table = m_Table; recordCtrl.m_sortRestrictColumnAccessType = m_sortRestrictColumnAccessType; recordCtrl.m_BaseObject = m_BaseObject; if (!string.IsNullOrEmpty(Request["UIColCount"])) { recordCtrl.m_iUIColCount = Convert.ToInt32(Request["UIColCount"]); } } if (Request.Params["Action"] == "Cancel") { m_BaseObject.Cancel(); Response.End(); } else if (Request.Params["Action"] == "PostData") { PostData(); //从编辑对象移除 EditObject.Remove(Session.SessionID, m_BaseObject); Response.End(); } }