Ejemplo n.º 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 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;

        m_Table = m_ActivesDefMgr.Table;

        if (Request.Params["Action"] == "Cancel")
        {
            m_ActivesDefMgr.Cancel();
            Response.End();
        }
        else if (Request.Params["Action"] == "PostData")
        {
            PostData();
            Response.End();
        }
    }
Ejemplo n.º 2
0
        void LoadData()
        {
            CActivesDefMgr ActivesDefMgr = new CActivesDefMgr();

            ActivesDefMgr.Ctx = Program.Ctx;
            string sWhere = string.Format("id='{0}'", m_Actives.WF_ActivesDef_id);

            ActivesDefMgr.GetList(sWhere);
            CActivesDef ActivesDef = (CActivesDef)ActivesDefMgr.GetFirstObj();

            if (ActivesDef != null)
            {
                txtName.Text = ActivesDef.Name;
            }
        }