Beispiel #1
0
    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 id = Request["id"];

        if (string.IsNullOrEmpty(id))
        {
            Response.End();
            return;
        }
        m_BaseObject = (CReport)m_Company.ReportMgr.Find(new Guid(id));
        if (m_BaseObject == null)
        {
            Response.End();
            return;
        }

        //保存到编辑对象
        EditObject.Add(Session.SessionID, m_BaseObject);

        if (Request.Params["Action"] == "GetData")
        {
            GetData();
            Response.End();
        }
        else if (Request.Params["Action"] == "Cancel")
        {
            Session["AddReport"] = null;
            Response.End();
        }
        else if (Request.Params["Action"] == "PostData")
        {
            PostData();
            //从编辑对象移除
            EditObject.Remove(Session.SessionID, m_BaseObject);

            Response.End();
        }
        else if (Request.Params["Action"] == "GetCondiction")
        {
            GetCondiction();
            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));
        }

        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();
        }
    }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null)
        {
            Response.Redirect("../../Login.aspx");
            Response.End();
        }

        string id = Request["id"];

        if (string.IsNullOrEmpty(id))
        {
            Response.Write("请选择表!");
            Response.End();
        }
        m_Table = (CTable)Global.GetCtx(Session["TopCompany"].ToString()).TableMgr.Find(new Guid(id));
        if (m_Table == null)
        {
            Response.Write("表不存在!");
            Response.End();
        }
        //保存到编辑对象
        EditObject.Add(Session.SessionID, m_Table);

        if (Request.Params["Action"] == "GetData")
        {
            GetData();
            Response.End();
        }
        else if (Request.Params["Action"] == "Cancel")
        {
            m_Table.Cancel();
            Response.End();
        }
        else if (Request.Params["Action"] == "PostData")
        {
            PostData();
            //从编辑对象移除
            EditObject.Remove(Session.SessionID, m_Table);

            Response.End();
        }
    }
Beispiel #4
0
    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.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();
        }
    }
Beispiel #6
0
    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();
        }
    }
Beispiel #7
0
    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 id = Request["id"];

        if (string.IsNullOrEmpty(id))
        {
            Response.End();
            return;
        }
        m_BaseObject = (CWorkflowDef)m_Company.WorkflowDefMgr.Find(new Guid(id));
        if (m_BaseObject == null)
        {
            Response.End();
            return;
        }

        //保存到编辑对象
        EditObject.Add(Session.SessionID, m_BaseObject);

        if (Request.Params["Action"] == "Cancel")
        {
            m_BaseObject.Cancel();
            Response.End();
        }
        else if (Request.Params["Action"] == "GetActivesData")
        {
            GetActivesData();
            Response.End();
        }
        else if (Request.Params["Action"] == "GetLinkData")
        {
            GetLinkData();
            Response.End();
        }
        else if (Request.Params["Action"] == "DeleteActivesDef")
        {
            DeleteActivesDef();
            Response.End();
        }
        else if (Request.Params["Action"] == "SelectTable")
        {
            SelectTable();
            Response.End();
        }
        else if (Request.Params["Action"] == "DeleteLink")
        {
            DeleteLink();
            Response.End();
        }
        else if (Request.Params["Action"] == "PostData")
        {
            PostData();
            //从编辑对象移除
            EditObject.Remove(Session.SessionID, m_BaseObject);

            Response.End();
        }
    }