private void BindDropDown()
    {
        // 默认下一环节
        EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);

        lb_AppName.Text = app.Model.Name;

        ddl_DefaultNextProcess.DataSource = app.GetProcessList();
        ddl_DefaultNextProcess.DataBind();
        ddl_DefaultNextProcess.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        ddl_Type.DataSource = DictionaryBLL.GetDicCollections("EWF_Flow_ProcessType");
        ddl_Type.DataBind();
        ddl_Type.SelectedValue = "8";

        ddl_OrganizeCityLevel.DataSource = DictionaryBLL.GetDicCollections("Addr_OrganizeCityLevel");
        ddl_OrganizeCityLevel.DataBind();
        ddl_OrganizeCityLevel.Items.Insert(0, new ListItem("发起人所在级别", "0"));

        ddl_DataObject_OrganizeCityID.DataSource = app.GetDataObjectList();
        ddl_DataObject_OrganizeCityID.DataBind();
        ddl_DataObject_OrganizeCityID.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        ddl_DataObject_OrganizeCityName.DataSource = app.GetDataObjectList();
        ddl_DataObject_OrganizeCityName.DataBind();
        ddl_DataObject_OrganizeCityName.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));
    }
    private void BindDropDown()
    {
        string condition            = " EnableFlag='Y' ";
        string CantApproveAlone_EWF = ConfigHelper.GetConfigString("CantApproveAlone_EWF");

        if (!string.IsNullOrEmpty(CantApproveAlone_EWF))
        {
            condition += " AND Code NOT IN ( " + CantApproveAlone_EWF + ")";
        }
        IList <EWF_Flow_App> apps = EWF_Flow_AppBLL.GetModelList(condition);

        ddl_App.DataSource = apps;
        ddl_App.DataBind();
        ddl_App.Items.Insert(0, new ListItem("请选择...", "0"));

        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);

        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = "0";
        }
    }
Example #3
0
    private void BindDropDown()
    {
        //所属流程
        EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);

        lb_AppName.Text = app.Model.Name;

        // 默认下一环节
        ddl_DefaultNextProcess.DataSource = app.GetProcessList();
        ddl_DefaultNextProcess.DataBind();
        ddl_DefaultNextProcess.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));


        ddl_Type.DataSource = DictionaryBLL.GetDicCollections("EWF_Flow_ProcessType");
        ddl_Type.DataBind();
        ddl_Type.SelectedValue = "6";

        ddl_DataObject_Mail.DataSource = app.GetDataObjectList();
        ddl_DataObject_Mail.DataBind();
        ddl_DataObject_Mail.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        ddl_RecipientRole_Mail.DataSource = EWF_RoleBLL.GetModelList("");
        ddl_RecipientRole_Mail.DataBind();
        ddl_RecipientRole_Mail.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));
        ddl_RecipientRole_Mail_SelectedIndexChanged(null, null);
    }
    private void BindDropDown()
    {
        EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);

        lb_AppName.Text = app.Model.Name;

        // 默认下一环节
        ddl_DefaultNextProcess.DataSource = app.GetProcessList();
        ddl_DefaultNextProcess.DataBind();
        ddl_DefaultNextProcess.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        //环节类型
        ddl_Type.DataSource = DictionaryBLL.GetDicCollections("EWF_Flow_ProcessType");
        ddl_Type.DataBind();
        this.ddl_Type.SelectedValue = "3";

        ddl_RecipientRole_Decision.DataSource = EWF_RoleBLL.GetModelList("");
        ddl_RecipientRole_Decision.DataBind();
        ddl_RecipientRole_Decision.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        ddl_DataObject_Decision.DataSource = app.GetDataObjectList();
        ddl_DataObject_Decision.DataBind();
        ddl_DataObject_Decision.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        ddl_PositiveNextProcess.DataSource = app.GetProcessList();
        ddl_PositiveNextProcess.DataBind();
        ddl_PositiveNextProcess.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        ddl_NegativeNextProcess.DataSource = app.GetProcessList();
        ddl_NegativeNextProcess.DataBind();
        ddl_NegativeNextProcess.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));
    }
    private void BindDropDown()
    {
        // 默认下一环节
        EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);

        lb_AppName.Text = app.Model.Name;

        ddl_DefaultNextProcess.DataSource = app.GetProcessList();
        ddl_DefaultNextProcess.DataBind();
        ddl_DefaultNextProcess.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));


        ddl_Type.DataSource = DictionaryBLL.GetDicCollections("EWF_Flow_ProcessType");
        ddl_Type.DataBind();
        ddl_Type.SelectedValue = "4";

        ddl_OperatorType.DataSource = DictionaryBLL.GetDicCollections("EWF_Flow_OperatorType");
        ddl_OperatorType.DataBind();

        ddl_DataObject_Condition.DataSource = app.GetDataObjectList();
        ddl_DataObject_Condition.DataBind();
        ddl_DataObject_Condition.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));


        ddl_TrueNextProcess.DataSource = app.GetProcessList();
        ddl_TrueNextProcess.DataBind();
        ddl_TrueNextProcess.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        ddl_FalseNextProcess.DataSource = app.GetProcessList();
        ddl_FalseNextProcess.DataBind();
        ddl_FalseNextProcess.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));
    }
Example #6
0
    private void BindDropDown()
    {
        IList <EWF_Flow_App> apps = EWF_Flow_AppBLL.GetModelList(" EnableFlag='Y' ");

        ddl_App.DataSource = apps;
        ddl_App.DataBind();
        ddl_App.Items.Insert(0, new ListItem("请选择...", "0"));

        #region 绑定当前操作员所能查看的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_FinishStatus.DataSource = DictionaryBLL.GetDicCollections("EWF_Flow_FinishStatus");
        ddl_FinishStatus.DataBind();
        ddl_FinishStatus.Items.Insert(0, new ListItem("全部", "0"));
    }
    private void BindDropDown()
    {
        IList <EWF_Flow_App> apps = EWF_Flow_AppBLL.GetModelList(" EnableFlag='Y' ");

        ddl_App.DataSource = apps;
        ddl_App.DataBind();
        ddl_App.Items.Insert(0, new ListItem("请选择...", "0"));
    }
 protected void bt_Copy_Click(object sender, EventArgs e)
 {
     if ((Guid)ViewState["AppID"] != Guid.Empty)
     {
         EWF_Flow_AppBLL.Copy((Guid)ViewState["AppID"]);
         Response.Redirect("FlowAppList.aspx");
     }
 }
 private void BindDropDown()
 {
     if ((Guid)ViewState["AppID"] != Guid.Empty)
     {
         EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);
         ddl_RelateDataObject.DataSource = app.GetDataObjectList();
         ddl_RelateDataObject.DataBind();
     }
     ddl_RelateDataObject.Items.Insert(0, new ListItem("请选择", Guid.Empty.ToString()));
 }
Example #10
0
    private void BindGrid()
    {
        EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);

        lb_AppName.Text = app.Model.Name;

        lb_AppName.NavigateUrl = "FlowAppDetail.aspx?AppID='" + app.Model.ID.ToString() + "'";

        gv_List.BindGrid <EWF_Flow_Process>(app.GetProcessList());
    }
Example #11
0
    private void BindDropDown()
    {
        string condition = " EnableFlag='Y'";

        IList <EWF_Flow_App> apps = EWF_Flow_AppBLL.GetModelList(condition);

        ddl_App.DataSource = apps;
        ddl_App.DataBind();
        ddl_App.Items.Insert(0, new ListItem("请选择...", "0"));

        ddl_DecisionResult.DataSource = DictionaryBLL.GetDicCollections("EWF_Task_DecisionResult");
        ddl_DecisionResult.DataBind();
        ddl_DecisionResult.Items.Insert(0, new ListItem("全部", "0"));
    }
    private void BindDropDown()
    {
        //所属流程
        EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);

        lb_AppName.Text = app.Model.Name;

        // 默认下一环节
        ddl_DefaultNextProcess.DataSource = app.GetProcessList();
        ddl_DefaultNextProcess.DataBind();
        ddl_DefaultNextProcess.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        ddl_Type.DataSource = DictionaryBLL.GetDicCollections("EWF_Flow_ProcessType");
        ddl_Type.DataBind();
    }
    protected void bt_OK_Click(object sender, EventArgs e)
    {
        EWF_Flow_AppBLL app;

        if ((Guid)ViewState["AppID"] != Guid.Empty)
        {
            app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]); //修改
        }
        else
        {
            //新增
            app = new EWF_Flow_AppBLL();
        }

        #region 获取界面信息
        app.Model.Description         = tbx_Description.Text;
        app.Model.Name                = tbx_Name.Text;
        app.Model.Code                = tbx_Code.Text;
        app.Model.Remark              = tbx_Remark.Text;
        app.Model.EnableFlag          = ddl_EnableFlag.SelectedValue;
        app.Model["RelateDataObject"] = ddl_RelateDataObject.SelectedValue;
        app.Model["RelateUrl"]        = tbx_RelateURL.Text;
        app.Model["CanBatchApprove"]  = rbl_CanBatchApprove.SelectedValue;
        #endregion

        if ((Guid)ViewState["AppID"] != Guid.Empty)
        {
            //修改
            app.Model.UpdateTime  = DateTime.Now;
            app.Model.UpdateStaff = int.Parse(Session["UserID"].ToString());

            if (app.Update() > 0)
            {
                MessageBox.Show(this, "更新记录保存成功!");
            }
        }
        else
        {
            //新增
            app.Model.InsertTime  = DateTime.Now;
            app.Model.InsertStaff = int.Parse(Session["UserID"].ToString());
            if (app.Add() > 0)
            {
                MessageBox.Show(this, "新增记录保存成功!");
            }
        }
        Response.Redirect("FlowAppList.aspx");
    }
Example #14
0
    private void BindGrid()
    {
        Org_Staff staff = new Org_StaffBLL((int)Session["UserID"]).Model;

        string condition = " ID IN (SELECT APP FROM EWF_Flow_InitPosition WHERE Position = " + staff.Position.ToString() + " AND " + DateTime.Today.Day.ToString() + " BETWEEN BeginDay AND EndDay)" + " AND EnableFlag='Y'";

        if (!string.IsNullOrEmpty(tbx_Condition.Text))
        {
            condition += "AND Name Like '%" + tbx_Condition.Text + "%'";
        }
        IList <EWF_Flow_App> apps = EWF_Flow_AppBLL.GetModelList(condition);

        gv_List.TotalRecordCount = apps.Count;
        gv_List.PageIndex        = (int)ViewState["PageIndex"];
        gv_List.BindGrid <EWF_Flow_App>(apps);
    }
    private void BindData()
    {
        EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);

        if (app.Model != null)
        {
            #region 绑定基本信息
            lb_ID.Text           = app.Model.ID.ToString();
            tbx_Name.Text        = app.Model.Name;
            tbx_Code.Text        = app.Model.Code;
            tbx_Description.Text = app.Model.Description;
            lbl_InsertSatff.Text = app.Model.InsertStaff == 0 ? "" : new Org_StaffBLL(app.Model.InsertStaff).Model.RealName;
            if (app.Model.InsertTime != new DateTime(1900, 1, 1))
            {
                lbl_InsertTime.Text = app.Model.InsertTime.ToShortDateString();
            }
            tbx_Remark.Text      = app.Model.Remark;
            lbl_UpdateStaff.Text = app.Model.UpdateStaff == 0 ? "" : new Org_StaffBLL(app.Model.UpdateStaff).Model.RealName;
            if (app.Model.UpdateTime != new DateTime(1900, 1, 1))
            {
                lbl_UpdateTime.Text = app.Model.UpdateTime.ToShortDateString();
            }
            ddl_EnableFlag.SelectedValue = app.Model.EnableFlag;

            rbl_CanBatchApprove.SelectedValue = app.Model["CanBatchApprove"] == "Y" ? "Y" : "N";

            ddl_RelateDataObject.SelectedValue = app.Model["RelateDataObject"];
            tbx_RelateURL.Text = app.Model["RelateUrl"];

            if (tbx_RelateURL.Text == "")
            {
                ddl_RelateObject.SelectedValue = "NULL";
            }
            else if (ddl_RelateObject.Items.FindByValue(tbx_RelateURL.Text) != null)
            {
                ddl_RelateObject.SelectedItem.Selected = false;
                ddl_RelateObject.Items.FindByValue(tbx_RelateURL.Text).Selected = true;
            }
            else
            {
                ddl_RelateObject.SelectedValue = "UserDefined";
            }
            ddl_RelateObject_SelectedIndexChanged(null, null);
            #endregion
        }
    }
    protected void bt_OK_Click(object sender, EventArgs e)
    {
        EWF_Flow_AppBLL app;
        if ((Guid)ViewState["AppID"] != Guid.Empty)
            app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]); //修改
        else
            //新增
            app = new EWF_Flow_AppBLL();

        #region 获取界面信息
        app.Model.Description = tbx_Description.Text;
        app.Model.Name = tbx_Name.Text;
        app.Model.Code = tbx_Code.Text;
        app.Model.Remark = tbx_Remark.Text;
        app.Model.EnableFlag = ddl_EnableFlag.SelectedValue;
        app.Model["RelateDataObject"] = ddl_RelateDataObject.SelectedValue;
        app.Model["RelateUrl"] = tbx_RelateURL.Text;
        app.Model["CanBatchApprove"] = rbl_CanBatchApprove.SelectedValue;
        #endregion

        if ((Guid)ViewState["AppID"] != Guid.Empty)
        {
            //修改
            app.Model.UpdateTime = DateTime.Now;
            app.Model.UpdateStaff = int.Parse(Session["UserID"].ToString());

            if (app.Update() > 0)
            {
                MessageBox.Show(this, "更新记录保存成功!");
            }
        }
        else
        {
            //新增
            app.Model.InsertTime = DateTime.Now;
            app.Model.InsertStaff = int.Parse(Session["UserID"].ToString());
            if (app.Add() > 0)
            {
                MessageBox.Show(this, "新增记录保存成功!");
            }
        }
        Response.Redirect("FlowAppList.aspx");
    }
Example #17
0
    private void BindDropDown()
    {
        Org_Staff staff = new Org_StaffBLL((int)Session["UserID"]).Model;

        string condition = "EnableFlag='Y'";// " ID IN (SELECT APP FROM EWF_Flow_InitPosition WHERE Position = " + staff.Position.ToString() + ")";

        IList <EWF_Flow_App> apps = EWF_Flow_AppBLL.GetModelList(condition);

        ddl_App.DataSource = apps;
        ddl_App.DataBind();
        ddl_App.Items.Insert(0, new ListItem("请选择...", "0"));

        ddl_Status.DataSource = DictionaryBLL.GetDicCollections("EWF_Task_TaskStatus");
        ddl_Status.DataBind();
        ddl_Status.Items.Insert(0, new ListItem("请选择...", "0"));

        ddl_FinishStatus.DataSource = DictionaryBLL.GetDicCollections("EWF_Flow_FinishStatus");
        ddl_FinishStatus.DataBind();
        ddl_FinishStatus.Items.Insert(0, new ListItem("全部", "0"));
    }
Example #18
0
    private void BindGrid()
    {
        string condition = "";

        if (MCSTabControl1.SelectedIndex == 0)//启用流程列表
        {
            condition = "EnableFlag = 'Y' ";
        }
        else //禁用流程列表
        {
            condition = "EnableFlag = 'N' ";
        }
        if (!string.IsNullOrEmpty(tbx_Condition.Text))
        {
            condition += "AND Name Like '%" + tbx_Condition.Text + "%'";
        }
        IList <EWF_Flow_App> apps = EWF_Flow_AppBLL.GetModelList(condition);

        gv_List.TotalRecordCount = apps.Count;
        gv_List.PageIndex        = (int)ViewState["PageIndex"];
        gv_List.BindGrid <EWF_Flow_App>(apps);
    }
    private void BindAppList(bool BindAllEWFApp)
    {
        IList <EWF_Flow_App> Apps;

        if (!BindAllEWFApp)
        {
            Apps = EWF_Flow_AppBLL.GetModelList(@"EnableFlag='Y' AND ID IN (SELECT DISTINCT EWF_Task.App
            FROM EWF_Task_Job INNER JOIN
                  EWF_Task_JobDecision ON EWF_Task_Job.ID = EWF_Task_JobDecision.Job INNER JOIN
                  EWF_Task ON EWF_Task_Job.Task = EWF_Task.ID
            WHERE EWF_Task_JobDecision.RecipientStaff=" + Session["UserID"].ToString() + " AND EWF_Task_Job.StartTime>DATEADD(MONTH,-3,GETDATE()) )");
        }
        else
        {
            Apps = EWF_Flow_AppBLL.GetModelList("EnableFlag='Y' ");
        }

        cbx_AppList.Items.Clear();
        foreach (EWF_Flow_App app in Apps.OrderBy(p => p.Name))
        {
            cbx_AppList.Items.Add(new ListItem(app.Name, app.ID.ToString()));
        }
    }
Example #20
0
    private void BindDropDown()
    {
        IList <EWF_Flow_App> apps = EWF_Flow_AppBLL.GetModelList(" EnableFlag='Y' ");

        ddl_App.DataSource = apps;
        ddl_App.DataBind();
        ddl_App.Items.Insert(0, new ListItem("请选择...", "0"));

        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);

        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = "0";
        }
    }
Example #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ViewState["TaskID"] = Request.QueryString["TaskID"] == null ? 0 : int.Parse(Request.QueryString["TaskID"]);

            if ((int)ViewState["TaskID"] != 0)
            {
                BindData();
            }
            else
            {
                if (Request.QueryString["AppID"] == null)
                {
                    MessageBox.ShowAndRedirect(this, "缺少必要参数!", "../Login/index.aspx");
                    return;
                }
                ViewState["AppID"] = new Guid(Request.QueryString["AppID"]);

                EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"], false);
                if (app.Model.RelateBusiness == "Y")
                {
                    MessageBox.ShowAndRedirect(this, "对不起,该流程不能直接发起,必须在业务系统中发起!", "FlowAppList.aspx");
                    return;
                }

                lbl_Applyer.Text = Session["UserRealName"].ToString();
                lbl_AppName.Text = app.Model.Name;

                lb_StartTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                lb_EndTime.Text   = "未结束";

                hyl_RelateURL.Visible = false;
            }
        }
    }
Example #22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ViewState["TaskID"] = Request.QueryString["TaskID"] == null ? 0 : int.Parse(Request.QueryString["TaskID"]);

            if ((int)ViewState["TaskID"] != 0)
            {
                BindData();
            }
            else
            {
                if (Request.QueryString["AppID"] == null)
                {
                    MessageBox.ShowAndRedirect(this, "缺少必要参数!", "../Login/index.aspx");
                    return;
                }
                ViewState["AppID"] = new Guid(Request.QueryString["AppID"]);

                EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"], false);
                if (app.Model.RelateBusiness == "Y")
                {
                    MessageBox.ShowAndRedirect(this, "对不起,该流程不能直接发起,必须在业务系统中发起!", "FlowAppList.aspx");
                    return;
                }

                lbl_Applyer.Text = Session["UserRealName"].ToString();
                lbl_AppName.Text = app.Model.Name;

                lb_StartTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                lb_EndTime.Text = "未结束";

                hyl_RelateURL.Visible = false;
            }
        }
    }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            ViewState["AppID"] = Request.QueryString["AppID"] != null ? new Guid(Request.QueryString["AppID"]) : Guid.Empty;

            if ((Guid)ViewState["AppID"] == Guid.Empty)
            {
                MessageBox.ShowAndRedirect(this, "缺少必要参数!", "../Login/Index.aspx");
                return;
            }

            ViewState["PageIndex"] = 0;
            //ViewState["Sort"] = "DisplayOrder";
            //ViewState["SortDirect"] = "ASC";

            BindDropDown();

            EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);
            lb_AppName.Text        = app.Model.Name;
            lb_AppName.NavigateUrl = "FlowAppDetail.aspx?AppID=" + ViewState["AppID"].ToString();

            ListTable <EWF_Flow_DataObject> lt = new ListTable <EWF_Flow_DataObject>(app.GetDataObjectList(), "Name");
            ViewState["ListTable"] = lt;

            BindGrid();

            #region 权限判断
            //Right right = new Right();
            //string strUserName = Session["UserName"].ToString();
            //if (!right.GetAccessPermission(strUserName, 110, 0)) Response.Redirect("../noaccessright.aspx");        //有无查看的权限
            //if (!right.GetAccessPermission(strUserName, 0, 1001)) bt_Add.Visible = false;                              //有无新增的权限
            #endregion
        }
    }
    private void BindDropDown()
    {
        //所属流程
        EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);
        lb_AppName.Text = app.Model.Name;

        // 默认下一环节
        ddl_DefaultNextProcess.DataSource = app.GetProcessList();
        ddl_DefaultNextProcess.DataBind();
        ddl_DefaultNextProcess.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        ddl_Type.DataSource = DictionaryBLL.GetDicCollections("EWF_Flow_ProcessType");
        ddl_Type.DataBind();
        ddl_Type.SelectedValue = "6";

        ddl_DataObject_Mail.DataSource = app.GetDataObjectList();
        ddl_DataObject_Mail.DataBind();
        ddl_DataObject_Mail.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        ddl_RecipientRole_Mail.DataSource = EWF_RoleBLL.GetModelList("");
        ddl_RecipientRole_Mail.DataBind();
        ddl_RecipientRole_Mail.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));
        ddl_RecipientRole_Mail_SelectedIndexChanged(null, null);
    }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            ViewState["AppID"] = Request.QueryString["AppID"] != null ? new Guid(Request.QueryString["AppID"]) : Guid.Empty;

            if ((Guid)ViewState["AppID"] == Guid.Empty)
            {
                MessageBox.ShowAndRedirect(this, "缺少必要参数!", "../Login/Index.aspx");
                return;
            }

            ViewState["PageIndex"] = 0;
            //ViewState["Sort"] = "DisplayOrder";
            //ViewState["SortDirect"] = "ASC";

            BindDropDown();

            EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);
            lb_AppName.Text = app.Model.Name;
            lb_AppName.NavigateUrl = "FlowAppDetail.aspx?AppID=" + ViewState["AppID"].ToString();

            ListTable<EWF_Flow_DataObject> lt = new ListTable<EWF_Flow_DataObject>(app.GetDataObjectList(), "Name");
            ViewState["ListTable"] = lt;

            BindGrid();

            #region 权限判断
            //Right right = new Right();
            //string strUserName = Session["UserName"].ToString();
            //if (!right.GetAccessPermission(strUserName, 110, 0)) Response.Redirect("../noaccessright.aspx");        //有无查看的权限
            //if (!right.GetAccessPermission(strUserName, 0, 1001)) bt_Add.Visible = false;                              //有无新增的权限
            #endregion
        }
    }
    //绑定开始环节详细信息
    private void BindTaskInfo()
    {
        EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);

        #region 如果任务在待审批状态,且正好是待当前人审批,则直接切换到审批页面
        if (task.Model.Status == 3)
        {
            int job = EWF_TaskBLL.StaffCanApproveTask(task.Model.ID, (int)Session["UserID"]);
            if (job > 0) Response.Redirect("Recipient.aspx?CurrentJobID=" + job.ToString() + "&TaskID=" + task.Model.ID.ToString());
        }
        #endregion

        EWF_Flow_App app = new EWF_Flow_AppBLL(task.Model.App).Model;

        #region 绑定流程信息
        lbl_ID.Text = task.Model.ID.ToString();
        lbl_Applyer.Text = new Org_StaffBLL(task.Model.Initiator).Model.RealName;
        lbl_AppName.Text = app.Name;

        lbl_Applyer_Position.Text = new Org_PositionBLL(new Org_StaffBLL(task.Model.Initiator).Model.Position).Model.Name;

        lbl_Title.Text = task.Model.Title;
        lb_Status.Text = DictionaryBLL.GetDicCollections("EWF_Task_TaskStatus")[task.Model.Status.ToString()].Name;

        lb_StartTime.Text = task.Model.StartTime.ToString();
        if (task.Model.EndTime != new DateTime(1900, 1, 1))
            lb_EndTime.Text = task.Model.EndTime.ToString();
        else
            lb_EndTime.Text = "未结束";

        lt_Remark.Text = task.Model.Remark;

        #region 绑定流程当前环节信息
        if (task.Model.Status < 5)
        {
            IList<EWF_Task_Job> jobs = EWF_Task_JobBLL.GetModelList("Task=" + task.Model.ID.ToString() + " ORDER BY StartTime DESC");
            if (jobs.Count > 0)
            {
                EWF_Flow_Process process = new EWF_Flow_ProcessBLL(jobs[0].CurrentProcess).Model;
                if (process != null)
                {
                    lb_CurrentJobInfo.Text = process.Name;
                    if (process.Type == 3)
                    {
                        lb_CurrentJobInfo.Text += " 等待审批人:";
                        foreach (EWF_Task_JobDecision decision in EWF_Task_JobDecisionBLL.GetModelList("Job=" + jobs[0].ID.ToString()))
                        {
                            MCSFramework.Model.Org_Staff staff = new Org_StaffBLL(decision.RecipientStaff).Model;
                            if (staff != null) lb_CurrentJobInfo.Text += staff.RealName + "   ";
                        }
                    }
                }
            }
        }
        else
            tr_CurrentProcessInfo.Visible = false;
        #endregion

        #endregion

        #region 控制流程状态
        if (task.Model.Initiator == (int)Session["UserID"])
        {
            //只有流程发起的本人,才可控制流程状态

            if (task.Model.Status == 6)
            {
                MessageBox.Show(this, "您的流程因故停止流转,请尽快联系系统管理员排查原因,或点击“继续执行”按钮以重新启动流程的流转!");
                bt_Restart.Visible = true;
            }

            if (task.Model.Status == 4)
            {
                MessageBox.Show(this, "您的流程被最后一审批人设为了待处理状态,请补充相关信息附件后,或点击“继续执行”按钮以重新启动流程的流转!");
                bt_Restart.Visible = true;

            }

            if (task.Model.Status == 1)
            {
                MessageBox.Show(this, "您的流程还没正式发起申请,请尽快点击“确定发起”按钮以发起流程!");
                btn_Start.Visible = true;
            }

            if (task.Model.Status != 5)
            {
                //未完成
                if (app.RelateBusiness == "N")
                    bt_Cancel.Visible = true;
                tr_UploadAtt.Visible = true;
            }
        }
        #endregion

        #region 显示申请详细信息IFrame
        //显示申请详细信息IFrame
        if (!string.IsNullOrEmpty(task.Model.RelateURL))
        {
            hyl_RelateURL.NavigateUrl = task.Model.RelateURL;
            tr_RelateUrl.Visible = true;
            string url = this.ResolveClientUrl(task.Model.RelateURL);
            if (url.IndexOf('?') >= 0)
                url += "&ViewFramework=False";
            else
                url += "?ViewFramework=False";
            frame_relateurl.Attributes.Add("src", url);
        }
        else
        {
            tr_RelateUrl.Visible = false;
            hyl_RelateURL.Visible = false;
        }
        #endregion

        //Bind the dataobject info
        pl_dataobjectinfo.BindData(task.Model.DataObjectValues);
        if (task.Model.Status > 1)
        {
            pl_dataobjectinfo.SetPanelEnable(false);

            TextBox tbx_ReMark = pl_dataobjectinfo.FindControl("C_Remark") != null ? (TextBox)pl_dataobjectinfo.FindControl("C_Remark") : null;
            if (tbx_ReMark != null)
            {
                tbx_ReMark.Enabled = true;
                tbx_ReMark.ReadOnly = true;
            }

        }

        //绑定环节列表
        gv_List_JobList.BindGrid<EWF_Task_Job>(task.GetJobList());
    }
        /// <summary>
        /// Init the components of the panel through the special pageid
        /// </summary>
        private void InitComponents()
        {
            Hashtable _htDataObjectdControlsInfo = new Hashtable();
            HtmlTable T_Content = new HtmlTable();
            T_Content.CellPadding = 0;
            T_Content.CellSpacing = 0;
            T_Content.Width = "100%";
            T_Content.Border = 0;
            T_Content.ID = "T_Content_" + ID;
            this.Controls.Add(T_Content);

            HtmlTableRow T_tr_title = new HtmlTableRow();
            HtmlTableCell T_tc_title = new HtmlTableCell();
            T_tr_title.Cells.Add(T_tc_title);
            T_Content.Rows.Add(T_tr_title);

            #region The title of the panel
            HtmlTable tb_title = new HtmlTable();
            T_tc_title.Controls.Add(tb_title);
            tb_title.CellPadding = 0;
            tb_title.CellSpacing = 0;
            tb_title.Width = "100%";
            tb_title.Height = "30px";
            tb_title.Border = 0;
            tb_title.Attributes["class"] = "h3Row";

            HtmlTableRow tr_title = new HtmlTableRow();
            HtmlTableCell tc_title = new HtmlTableCell();
            tr_title.Cells.Add(tc_title);
            tb_title.Rows.Add(tr_title);
            tc_title.InnerHtml = "<h3>工作流提交的数据字段内容</h3>";
            #endregion

            #region The content of the panel
            HtmlTableRow T_tr_panelcontent = new HtmlTableRow();
            T_tr_panelcontent.ID = "T_tr_panelcontent";
            HtmlTableCell T_tc_panelcontent = new HtmlTableCell();
            T_tr_panelcontent.Cells.Add(T_tc_panelcontent);
            T_Content.Rows.Add(T_tr_panelcontent);

            HtmlTable tb_panel_content = new HtmlTable();
            tb_panel_content.Width = "100%";
            tb_panel_content.Attributes["class"] = "tabForm";
            T_tc_panelcontent.Controls.Add(tb_panel_content);
            IList<EWF_Flow_DataObject> _dataobjects = new EWF_Flow_AppBLL(App).GetDataObjectList();
            int i = 0;
            foreach (EWF_Flow_DataObject _dataobject in _dataobjects)
            {
                if (_dataobject.Visible == "N") continue;

                #region 判断该控件是否已存在
                if (_htDataObjectdControlsInfo.Contains(_dataobject.Name)) continue;
                #endregion

                #region 判断是否要增加新行
                HtmlTableRow tr_panel_detail;
                if (i >= FieldCount || i == 0)
                {
                    tr_panel_detail = new HtmlTableRow();
                    tb_panel_content.Rows.Add(tr_panel_detail);
                    i = 0;
                }
                else
                {
                    tr_panel_detail = tb_panel_content.Rows[tb_panel_content.Rows.Count - 1];
                }
                #endregion

                #region 增加Label Cell
                HtmlTableCell tc_displayname = new HtmlTableCell();
                tc_displayname.Attributes["Class"] = "dataLabel";
                tc_displayname.Attributes["Style"] = "width: 80px; height: 18px;";
                tc_displayname.Attributes["nowrap"] = "nowrap";
                tc_displayname.InnerText = _dataobject.DisplayName;
                tr_panel_detail.Cells.Add(tc_displayname);
                #endregion

                #region 增加Field Cell
                HtmlTableCell tc_control = new HtmlTableCell();
                tc_control.Attributes["Class"] = "dataField";

                if (_dataobject.ColSpan > 0)
                {
                    if (i + _dataobject.ColSpan <= FieldCount)
                    {
                        tc_control.ColSpan = 2 * _dataobject.ColSpan - 1;
                        i = i + _dataobject.ColSpan;
                    }
                    else
                    {
                        tc_control.ColSpan = 2 * (FieldCount - i) - 1;
                        i = 0;
                    }
                }
                else
                {
                    i++;
                }

                WebControl control = null;

                int RelationType = _dataobject.RelationType;
                string RelationTableName = _dataobject.RelationTableName;
                string RelationValueField = _dataobject.RelationValueField;
                string RelationTextField = _dataobject.RelationTextField;

                #region 根据控件类型生成相应的控件
                switch (_dataobject.ControlType)
                {
                    case 1://Label
                        control = new Label();
                        break;
                    case 2://TextBox
                        control = new TextBox();
                        if (_dataobject.DataType == 4)
                        {
                            control.Attributes["onfocus"] = "setday(this);";
                        }
                        break;
                    case 3://DropDownList
                        control = new DropDownList();
                        if (RelationType == 1)//Relation to the dictionary
                        {
                            ((DropDownList)control).DataSource = DictionaryBLL.GetDicCollections(RelationTableName, true);
                        }
                        else if (RelationType == 2)//Relation to the model table
                        {
                            ((DropDownList)control).DataSource = TreeTableBLL.GetRelationTableSourceData(RelationTableName, RelationValueField, RelationTextField);
                        }
                        else
                            break;

                        ((DropDownList)control).DataTextField = "Value";
                        ((DropDownList)control).DataValueField = "Key";
                        ((DropDownList)control).DataBind();
                        ((DropDownList)control).Items.Insert(0, new ListItem("请选择...", "0"));
                        break;
                    case 4://RadioButtonList
                        control = new RadioButtonList();
                        if (RelationType == 1)//Relation to the dictionary
                        {
                            ((RadioButtonList)control).DataSource = DictionaryBLL.GetDicCollections(RelationTableName, true);
                        }
                        else if (RelationType == 2)//Relation to the model table
                        {
                            ((RadioButtonList)control).DataSource = TreeTableBLL.GetRelationTableSourceData(RelationTableName, RelationValueField, RelationTextField);
                        }
                        else
                            break;

                        ((RadioButtonList)control).RepeatColumns = 6;
                        ((RadioButtonList)control).RepeatDirection = RepeatDirection.Horizontal;
                        ((RadioButtonList)control).DataTextField = "Value";
                        ((RadioButtonList)control).DataValueField = "Key";
                        ((RadioButtonList)control).DataBind();
                        if (((RadioButtonList)control).Items.Count != 0) ((RadioButtonList)control).SelectedIndex = 0;
                        break;
                    case 5://MutiLinesTextBox
                        control = new TextBox();
                        ((TextBox)control).TextMode = TextBoxMode.MultiLine;
                        if (_dataobject.ControlHeight > 0) ((TextBox)control).Height = new Unit(_dataobject.ControlHeight);
                        break;
                    case 6://TextBox supports search
                        control = new MCSSelectControl();
                        control.ID = "C_" + _dataobject.Name.ToString();
                        if (RelationType == 2)//Relation to the model table
                        {
                            ((MCSSelectControl)control).PageUrl = _dataobject.SearchPageURL;
                        }
                        break;
                    case 7://MCSTreeControl

                        control = new MCSTreeControl();

                        if (RelationType == 2)//Relation to the model table
                        {
                            control.ID = "C_" + _dataobject.Name.ToString();    //在设置控件DataSource之前,必须要有ID属性 Shen Gang 20090110
                            if (_dataobject.RelationTableName == "MCS_SYS.dbo.Addr_OrganizeCity")
                            {
                                #region 如果为管理片区字段,则取员工所能管辖的片区
                                Org_StaffBLL staff = new Org_StaffBLL((int)System.Web.HttpContext.Current.Session["UserID"]);
                                ((MCSTreeControl)control).DataSource = staff.GetStaffOrganizeCity();
                                ((MCSTreeControl)control).IDColumnName = "ID";
                                ((MCSTreeControl)control).NameColumnName = "Name";
                                ((MCSTreeControl)control).ParentColumnName = "SuperID";

                                if (((MCSTreeControl)control).DataSource.Select("ID = 1").Length > 0 || staff.Model.OrganizeCity == 0)
                                {
                                    ((MCSTreeControl)control).RootValue = "0";
                                    if (!Page.IsPostBack) ((MCSTreeControl)control).SelectValue = "0";
                                }
                                else
                                {
                                    ((MCSTreeControl)control).RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
                                    if (!Page.IsPostBack) ((MCSTreeControl)control).SelectValue = staff.Model.OrganizeCity.ToString();
                                }

                                #endregion
                            }
                            else
                            {
                                ((MCSTreeControl)control).TableName = RelationTableName;
                                ((MCSTreeControl)control).IDColumnName = RelationValueField;
                                ((MCSTreeControl)control).NameColumnName = RelationTextField;
                                ((MCSTreeControl)control).ParentColumnName = "SuperID";
                            }
                        }
                        break;
                }
                #endregion

                control.ID = "C_" + _dataobject.Name.ToString();
                control.Enabled = _dataobject.Enable.ToUpper() == "Y";
                control.ToolTip = _dataobject.Description;
                if (_dataobject.ControlWidth > 0) control.Width = _dataobject.ControlWidth;

                tc_control.Controls.Add(control);

                #region 如果是文本框时,加上输入验证控件
                if (_dataobject.IsRequireField == "Y")
                {
                    Label lbl_reqinfo = new Label();
                    lbl_reqinfo.Text = "*";
                    lbl_reqinfo.ForeColor = System.Drawing.Color.Red;
                    tc_control.Controls.Add(lbl_reqinfo);
                }
                //add validate control for the textbox

                if (_dataobject.ControlType == 2 || _dataobject.ControlType == 5)
                {
                    RequiredFieldValidator _requiredfieldvalidator = null;
                    CompareValidator _comparevalidator = null;
                    RegularExpressionValidator _regularexpressionvalidator = null;
                    if (_dataobject.IsRequireField == "Y")
                    {
                        _requiredfieldvalidator = new RequiredFieldValidator();
                        _requiredfieldvalidator.ControlToValidate = control.ID;
                        _requiredfieldvalidator.Display = ValidatorDisplay.Dynamic;
                        _requiredfieldvalidator.ErrorMessage = "必填";
                        _requiredfieldvalidator.ForeColor = System.Drawing.Color.Red;
                        _requiredfieldvalidator.ValidationGroup = _validationgroup;

                        tc_control.Controls.Add(_requiredfieldvalidator);
                    }

                    if (_dataobject.DataType == 1 || _dataobject.DataType == 2 || _dataobject.DataType == 4)        //非varchar 字符串
                    {
                        _comparevalidator = new CompareValidator();
                        _comparevalidator.ControlToValidate = control.ID;
                        _comparevalidator.Operator = ValidationCompareOperator.DataTypeCheck;
                        _comparevalidator.Display = ValidatorDisplay.Dynamic;
                        _comparevalidator.ForeColor = System.Drawing.Color.Red;
                        _comparevalidator.ValidationGroup = _validationgroup;

                        if (_dataobject.DataType == 1)//int
                        {
                            _comparevalidator.Type = ValidationDataType.Integer;
                            _comparevalidator.ErrorMessage = "应为整数";

                        }
                        if (_dataobject.DataType == 2)//decimal
                        {
                            _comparevalidator.Type = ValidationDataType.Double;
                            _comparevalidator.ErrorMessage = "应为数字";
                        }
                        if (_dataobject.DataType == 4)//datetime
                        {
                            _comparevalidator.Type = ValidationDataType.Date;
                            _comparevalidator.ErrorMessage = "日期格式不正确";
                        }
                        tc_control.Controls.Add(_comparevalidator);
                    }
                    else
                    {
                        if (_dataobject.RegularExpression != "")
                        {
                            _regularexpressionvalidator = new RegularExpressionValidator();
                            _regularexpressionvalidator.ControlToValidate = control.ID;
                            _regularexpressionvalidator.ErrorMessage = "数据格式不正确";
                            _regularexpressionvalidator.ForeColor = System.Drawing.Color.Red;
                            _regularexpressionvalidator.ValidationExpression = _dataobject.RegularExpression;
                            _regularexpressionvalidator.ValidationGroup = ValidationGroup;
                            _regularexpressionvalidator.Display = ValidatorDisplay.Dynamic;
                            tc_control.Controls.Add(_regularexpressionvalidator);
                        }
                    }
                }
                #endregion

                tr_panel_detail.Cells.Add(tc_control);
                #endregion

                #region Record the info of the control created
                DataObjectControlInfo dataobjectcontrolinfo = new DataObjectControlInfo();

                dataobjectcontrolinfo.ControlName = control.ID;
                dataobjectcontrolinfo.ControlType = _dataobject.ControlType;
                dataobjectcontrolinfo.DataObjectID = _dataobject.ID;
                dataobjectcontrolinfo.DataObjectName = _dataobject.Name;
                _htDataObjectdControlsInfo.Add(dataobjectcontrolinfo.DataObjectName, dataobjectcontrolinfo);
                #endregion
            }
            #endregion

            ViewState["HTDataObjectControlInfo"] = _htDataObjectdControlsInfo;

            if (new EWF_Flow_AppBLL(App).Model.RelateBusiness.ToUpper() == "Y")
                SetPanelEnable(false);
        }
Example #28
0
    protected void bt_Submit_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ID"] != 0)
        {
            if (gv_List.Rows.Count == 0)
            {
                MessageBox.Show(this, "对不起, 必须添加相应的费用明细!");
                return;
            }

            bt_Save_Click(null, null);

            FNA_FeeApplyBLL bll = new FNA_FeeApplyBLL((int)ViewState["ID"]);
            if (bll.Model.State != 1)
            {
                MessageBox.Show(this, "对不起,该申请单不为草稿状态,不能提交!");
                return;
            }

            if (bll.Model.Client == 0 && !cbx_NoInsteadPayClient.Checked)
            {
                MessageBox.Show(this, "请正确选择费用代垫客户,如果确认无代垫客户,请勾选【确认无代垫客户】复选框!");
                return;
            }

            if (cbx_NoInsteadPayClient.Checked && bll.Model.Client != 0)
            {
                MessageBox.Show(this, "您已选择了费用代垫客户,又请勾选【确认无代垫客户】复选框,两者只能选择其一,请确认!");
                return;
            }

            #region 判断预算额度余额是否够申请
            if (((Dictionary_Data)ViewState["DicFeeType"]).Description == "BudgetControl")
            {
                decimal _balance   = FNA_BudgetBLL.GetUsableAmount(bll.Model.AccountMonth, bll.Model.OrganizeCity, bll.Model.FeeType);
                decimal _applycost = decimal.Parse(lb_TotalCost.Text);
                lb_BudgetAmount.Text = _balance.ToString("0.###");

                if (bll.Model.FeeType == ConfigHelper.GetConfigInt("GiftFeeType"))
                {
                    _balance = GetGiftAmountBalance();
                }

                if (_balance < _applycost)
                {
                    MessageBox.Show(this, "对不起,您当前的预算余额不够申请该项费用!");
                    return;
                }
            }
            #endregion

            #region 发起工作流
            NameValueCollection dataobjects = new NameValueCollection();
            dataobjects.Add("ID", ViewState["ID"].ToString());
            dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
            dataobjects.Add("AccountMonth", bll.Model.AccountMonth.ToString());
            dataobjects.Add("TotalFee", lb_TotalCost.Text);
            dataobjects.Add("BorrowFee", lb_BorrowTotal.Text);
            dataobjects.Add("FeeType", bll.Model.FeeType.ToString());
            dataobjects.Add("AccountTitleType", bll.Model["AccountTitle2"]);

            #region 组合审批任务主题
            string title = bll.Model["Title"] + ",申请备案号:" + bll.Model.SheetCode + ",总费用:" + lb_TotalCost.Text;
            #endregion

            string AppCode = "FNA_FeeApplyFlow";
            if (EWF_Flow_AppBLL.GetModelList("Code='" + AppCode + "_" + bll.Model.FeeType.ToString() +
                                             "' AND EnableFlag='Y'").Count > 0)
            {
                AppCode = AppCode + "_" + bll.Model.FeeType.ToString();
            }

            if (bll.Model["AccountTitle2"] == "81")//导购管理费
            {
                AppCode = "FNA_FeeApplyFlow_8";
            }

            int TaskID = EWF_TaskBLL.NewTask(AppCode, (int)Session["UserID"], title, "~/SubModule/FNA/FeeApply/FeeApplyDetail3.aspx?ID=" + ViewState["ID"].ToString(), dataobjects);
            if (TaskID <= 0)
            {
                MessageBox.Show(this, "对不起,工作流发起失败,请与管理员联系!");
                return;
            }
            new EWF_TaskBLL(TaskID).Start();        //直接启动流程
            #endregion

            bll.Submit((int)Session["UserID"], TaskID);

            MessageBox.ShowAndRedirect(this, "费用申请提交成功!", "FeeApplyList.aspx?FeeType=" + ViewState["FeeType"].ToString() + "&AccountMonth=" + ViewState["AccountMonth"].ToString());
        }
    }
Example #29
0
    //绑定开始环节详细信息
    private void BindTaskInfo()
    {
        EWF_TaskBLL task = new EWF_TaskBLL((int)ViewState["TaskID"]);

        #region 如果任务在待审批状态,且正好是待当前人审批,则直接切换到审批页面
        if (task.Model.Status == 3)
        {
            int job = EWF_TaskBLL.StaffCanApproveTask(task.Model.ID, (int)Session["UserID"]);
            if (job > 0)
            {
                Response.Redirect("Recipient.aspx?CurrentJobID=" + job.ToString() + "&TaskID=" + task.Model.ID.ToString());
            }
        }
        #endregion

        EWF_Flow_App app = new EWF_Flow_AppBLL(task.Model.App).Model;

        #region 绑定流程信息
        lbl_ID.Text      = task.Model.ID.ToString();
        lbl_Applyer.Text = new Org_StaffBLL(task.Model.Initiator).Model.RealName;
        lbl_AppName.Text = app.Name;

        lbl_Applyer_Position.Text = new Org_PositionBLL(new Org_StaffBLL(task.Model.Initiator).Model.Position).Model.Name;

        lbl_Title.Text = task.Model.Title;
        lb_Status.Text = DictionaryBLL.GetDicCollections("EWF_Task_TaskStatus")[task.Model.Status.ToString()].Name;

        lb_StartTime.Text = task.Model.StartTime.ToString();
        if (task.Model.EndTime != new DateTime(1900, 1, 1))
        {
            lb_EndTime.Text = task.Model.EndTime.ToString();
        }
        else
        {
            lb_EndTime.Text = "未结束";
        }

        lt_Remark.Text = task.Model.Remark;

        #region 绑定流程当前环节信息
        if (task.Model.Status < 5)
        {
            IList <EWF_Task_Job> jobs = EWF_Task_JobBLL.GetModelList("Task=" + task.Model.ID.ToString() + " ORDER BY StartTime DESC");
            if (jobs.Count > 0)
            {
                EWF_Flow_Process process = new EWF_Flow_ProcessBLL(jobs[0].CurrentProcess).Model;
                if (process != null)
                {
                    lb_CurrentJobInfo.Text = process.Name;
                    if (process.Type == 3)
                    {
                        lb_CurrentJobInfo.Text += " 等待审批人:";
                        foreach (EWF_Task_JobDecision decision in EWF_Task_JobDecisionBLL.GetModelList("Job=" + jobs[0].ID.ToString()))
                        {
                            MCSFramework.Model.Org_Staff staff = new Org_StaffBLL(decision.RecipientStaff).Model;
                            if (staff != null)
                            {
                                lb_CurrentJobInfo.Text += staff.RealName + "   ";
                            }
                        }
                    }
                }
            }
        }
        else
        {
            tr_CurrentProcessInfo.Visible = false;
        }
        #endregion

        #endregion

        #region 控制流程状态
        if (task.Model.Initiator == (int)Session["UserID"])
        {
            //只有流程发起的本人,才可控制流程状态

            if (task.Model.Status == 6)
            {
                MessageBox.Show(this, "您的流程因故停止流转,请尽快联系系统管理员排查原因,或点击“继续执行”按钮以重新启动流程的流转!");
                bt_Restart.Visible = true;
            }

            if (task.Model.Status == 4)
            {
                MessageBox.Show(this, "您的流程被最后一审批人设为了待处理状态,请补充相关信息附件后,或点击“继续执行”按钮以重新启动流程的流转!");
                bt_Restart.Visible = true;
            }

            if (task.Model.Status == 1)
            {
                MessageBox.Show(this, "您的流程还没正式发起申请,请尽快点击“确定发起”按钮以发起流程!");
                btn_Start.Visible = true;
            }

            if (task.Model.Status != 5)
            {
                //未完成
                if (app.RelateBusiness == "N")
                {
                    bt_Cancel.Visible = true;
                }
                tr_UploadAtt.Visible = true;
            }
        }
        #endregion

        #region 显示申请详细信息IFrame
        //显示申请详细信息IFrame
        if (!string.IsNullOrEmpty(task.Model.RelateURL))
        {
            hyl_RelateURL.NavigateUrl = task.Model.RelateURL;
            tr_RelateUrl.Visible      = true;
            string url = this.ResolveClientUrl(task.Model.RelateURL);
            if (url.IndexOf('?') >= 0)
            {
                url += "&ViewFramework=False";
            }
            else
            {
                url += "?ViewFramework=False";
            }
            frame_relateurl.Attributes.Add("src", url);
        }
        else
        {
            tr_RelateUrl.Visible  = false;
            hyl_RelateURL.Visible = false;
        }
        #endregion


        //Bind the dataobject info
        pl_dataobjectinfo.BindData(task.Model.DataObjectValues);
        if (task.Model.Status > 1)
        {
            pl_dataobjectinfo.SetPanelEnable(false);

            TextBox tbx_ReMark = pl_dataobjectinfo.FindControl("C_Remark") != null ? (TextBox)pl_dataobjectinfo.FindControl("C_Remark") : null;
            if (tbx_ReMark != null)
            {
                tbx_ReMark.Enabled  = true;
                tbx_ReMark.ReadOnly = true;
            }
        }

        //绑定环节列表
        gv_List_JobList.BindGrid <EWF_Task_Job>(task.GetJobList());
    }
 private void BindDropDown()
 {
     if ((Guid)ViewState["AppID"] != Guid.Empty)
     {
         EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);
         ddl_RelateDataObject.DataSource = app.GetDataObjectList();
         ddl_RelateDataObject.DataBind();
     }
     ddl_RelateDataObject.Items.Insert(0, new ListItem("请选择", Guid.Empty.ToString()));
 }
    private void BindGrid()
    {
        string condition = "(StartTime BETWEEN '" + tbx_begin.Text + "' AND '" + tbx_end.Text + " 23:59:59')";

        condition += " AND Status=" + MCSTabControl1.SelectedTabItem.Value.ToString();

        if (ddl_App.SelectedValue != "0")
        {
            condition += " AND (App = '" + ddl_App.SelectedValue + "')";
        }
        else
        if (ddl_App.Items.Count > 1 && ViewState["EWFCode"].ToString() != "")
        {
            string    apps   = "";
            DataTable dt_app = EWF_Flow_AppBLL.GetModelByClassify(ViewState["EWFCode"].ToString());
            foreach (DataRow app in dt_app.Rows)
            {
                if (apps != "")
                {
                    apps += ",";
                }
                apps += "'" + app["ID"] + "'";
            }
            condition += " AND (App IN (" + apps + "))";
        }


        if (select_Staff.SelectValue != "" && select_Staff.SelectValue != "0")
        {
            condition += " AND Initiator = " + select_Staff.SelectValue;
        }
        else
        {
            #region 判断当前可查询的范围
            string orgcitys = "";
            if (tr_OrganizeCity.SelectValue != "1")
            {
                Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue), true);
                orgcitys = orgcity.GetAllChildNodeIDs();
                if (orgcitys != "")
                {
                    orgcitys += ",";
                }
                orgcitys += tr_OrganizeCity.SelectValue;

                condition += " AND Initiator IN (SELECT ID FROM MCS_SYS.dbo.Org_Staff WHERE OrganizeCity IN (" + orgcitys + "))";
            }
            #endregion
        }
        if (tbx_KeyWords.Text != "")
        {
            condition += " AND (Title like '%" + tbx_KeyWords.Text +
                         "%' OR  CAST (ID AS VARCHAR)='" + tbx_KeyWords.Text + "')";
        }

        if (ddl_FinishStatus.SelectedValue != "0")
        {
            condition += " AND FinishStatus = " + ddl_FinishStatus.SelectedValue;
        }

        //condition += " ORDER BY ID desc";
        gv_List.PageIndex = (int)ViewState["PageIndex"];
        IList <EWF_Task> tasks = EWF_TaskBLL.GetModelList(condition);
        gv_List.BindGrid <EWF_Task>(tasks);
    }
Example #32
0
        /// <summary>
        /// Init the components of the panel through the special pageid
        /// </summary>
        private void InitComponents()
        {
            Hashtable _htDataObjectdControlsInfo = new Hashtable();
            HtmlTable T_Content = new HtmlTable();

            T_Content.CellPadding = 0;
            T_Content.CellSpacing = 0;
            T_Content.Width       = "100%";
            T_Content.Border      = 0;
            T_Content.ID          = "T_Content_" + ID;
            this.Controls.Add(T_Content);

            HtmlTableRow  T_tr_title = new HtmlTableRow();
            HtmlTableCell T_tc_title = new HtmlTableCell();

            T_tr_title.Cells.Add(T_tc_title);
            T_Content.Rows.Add(T_tr_title);

            #region The title of the panel
            HtmlTable tb_title = new HtmlTable();
            T_tc_title.Controls.Add(tb_title);
            tb_title.CellPadding         = 0;
            tb_title.CellSpacing         = 0;
            tb_title.Width               = "100%";
            tb_title.Height              = "30px";
            tb_title.Border              = 0;
            tb_title.Attributes["class"] = "h3Row";

            HtmlTableRow  tr_title = new HtmlTableRow();
            HtmlTableCell tc_title = new HtmlTableCell();
            tr_title.Cells.Add(tc_title);
            tb_title.Rows.Add(tr_title);
            tc_title.InnerHtml = "<h3>工作流提交的数据字段内容</h3>";
            #endregion

            #region The content of the panel
            HtmlTableRow T_tr_panelcontent = new HtmlTableRow();
            T_tr_panelcontent.ID = "T_tr_panelcontent";
            HtmlTableCell T_tc_panelcontent = new HtmlTableCell();
            T_tr_panelcontent.Cells.Add(T_tc_panelcontent);
            T_Content.Rows.Add(T_tr_panelcontent);


            HtmlTable tb_panel_content = new HtmlTable();
            tb_panel_content.Width = "100%";
            tb_panel_content.Attributes["class"] = "tabForm";
            T_tc_panelcontent.Controls.Add(tb_panel_content);
            IList <EWF_Flow_DataObject> _dataobjects = new EWF_Flow_AppBLL(App).GetDataObjectList();
            int i = 0;
            foreach (EWF_Flow_DataObject _dataobject in _dataobjects)
            {
                if (_dataobject.Visible == "N")
                {
                    continue;
                }

                #region 判断该控件是否已存在
                if (_htDataObjectdControlsInfo.Contains(_dataobject.Name))
                {
                    continue;
                }
                #endregion

                #region 判断是否要增加新行
                HtmlTableRow tr_panel_detail;
                if (i >= FieldCount || i == 0)
                {
                    tr_panel_detail = new HtmlTableRow();
                    tb_panel_content.Rows.Add(tr_panel_detail);
                    i = 0;
                }
                else
                {
                    tr_panel_detail = tb_panel_content.Rows[tb_panel_content.Rows.Count - 1];
                }
                #endregion

                #region 增加Label Cell
                HtmlTableCell tc_displayname = new HtmlTableCell();
                tc_displayname.Attributes["Class"]  = "dataLabel";
                tc_displayname.Attributes["Style"]  = "width: 80px; height: 18px;";
                tc_displayname.Attributes["nowrap"] = "nowrap";
                tc_displayname.InnerText            = _dataobject.DisplayName;
                tr_panel_detail.Cells.Add(tc_displayname);
                #endregion

                #region 增加Field Cell
                HtmlTableCell tc_control = new HtmlTableCell();
                tc_control.Attributes["Class"] = "dataField";

                if (_dataobject.ColSpan > 0)
                {
                    if (i + _dataobject.ColSpan <= FieldCount)
                    {
                        tc_control.ColSpan = 2 * _dataobject.ColSpan - 1;
                        i = i + _dataobject.ColSpan;
                    }
                    else
                    {
                        tc_control.ColSpan = 2 * (FieldCount - i) - 1;
                        i = 0;
                    }
                }
                else
                {
                    i++;
                }

                WebControl control = null;

                int    RelationType       = _dataobject.RelationType;
                string RelationTableName  = _dataobject.RelationTableName;
                string RelationValueField = _dataobject.RelationValueField;
                string RelationTextField  = _dataobject.RelationTextField;

                #region 根据控件类型生成相应的控件
                switch (_dataobject.ControlType)
                {
                case 1:    //Label
                    control = new Label();
                    break;

                case 2:    //TextBox
                    control = new TextBox();
                    if (_dataobject.DataType == 4)
                    {
                        control.Attributes["onfocus"] = "setday(this);";
                    }
                    break;

                case 3:                    //DropDownList
                    control = new DropDownList();
                    if (RelationType == 1) //Relation to the dictionary
                    {
                        ((DropDownList)control).DataSource = DictionaryBLL.GetDicCollections(RelationTableName, true);
                    }
                    else if (RelationType == 2)    //Relation to the model table
                    {
                        ((DropDownList)control).DataSource = TreeTableBLL.GetRelationTableSourceData(RelationTableName, RelationValueField, RelationTextField);
                    }
                    else
                    {
                        break;
                    }

                    ((DropDownList)control).DataTextField  = "Value";
                    ((DropDownList)control).DataValueField = "Key";
                    ((DropDownList)control).DataBind();
                    ((DropDownList)control).Items.Insert(0, new ListItem("请选择...", "0"));
                    break;

                case 4:                    //RadioButtonList
                    control = new RadioButtonList();
                    if (RelationType == 1) //Relation to the dictionary
                    {
                        ((RadioButtonList)control).DataSource = DictionaryBLL.GetDicCollections(RelationTableName, true);
                    }
                    else if (RelationType == 2)    //Relation to the model table
                    {
                        ((RadioButtonList)control).DataSource = TreeTableBLL.GetRelationTableSourceData(RelationTableName, RelationValueField, RelationTextField);
                    }
                    else
                    {
                        break;
                    }

                    ((RadioButtonList)control).RepeatColumns   = 6;
                    ((RadioButtonList)control).RepeatDirection = RepeatDirection.Horizontal;
                    ((RadioButtonList)control).DataTextField   = "Value";
                    ((RadioButtonList)control).DataValueField  = "Key";
                    ((RadioButtonList)control).DataBind();
                    if (((RadioButtonList)control).Items.Count != 0)
                    {
                        ((RadioButtonList)control).SelectedIndex = 0;
                    }
                    break;

                case 5:    //MutiLinesTextBox
                    control = new TextBox();
                    ((TextBox)control).TextMode = TextBoxMode.MultiLine;
                    if (_dataobject.ControlHeight > 0)
                    {
                        ((TextBox)control).Height = new Unit(_dataobject.ControlHeight);
                    }
                    break;

                case 6:    //TextBox supports search
                    control    = new MCSSelectControl();
                    control.ID = "C_" + _dataobject.Name.ToString();
                    if (RelationType == 2)    //Relation to the model table
                    {
                        ((MCSSelectControl)control).PageUrl = _dataobject.SearchPageURL;
                    }
                    break;

                case 7:    //MCSTreeControl

                    control = new MCSTreeControl();


                    if (RelationType == 2)                               //Relation to the model table
                    {
                        control.ID = "C_" + _dataobject.Name.ToString(); //在设置控件DataSource之前,必须要有ID属性 Shen Gang 20090110
                        if (_dataobject.RelationTableName == "MCS_SYS.dbo.Addr_OrganizeCity")
                        {
                            #region 如果为管理片区字段,则取员工所能管辖的片区
                            Org_StaffBLL staff = new Org_StaffBLL((int)System.Web.HttpContext.Current.Session["UserID"]);
                            ((MCSTreeControl)control).DataSource       = staff.GetStaffOrganizeCity();
                            ((MCSTreeControl)control).IDColumnName     = "ID";
                            ((MCSTreeControl)control).NameColumnName   = "Name";
                            ((MCSTreeControl)control).ParentColumnName = "SuperID";

                            if (((MCSTreeControl)control).DataSource.Select("ID = 1").Length > 0 || staff.Model.OrganizeCity == 0)
                            {
                                ((MCSTreeControl)control).RootValue = "0";
                                if (!Page.IsPostBack)
                                {
                                    ((MCSTreeControl)control).SelectValue = "0";
                                }
                            }
                            else
                            {
                                ((MCSTreeControl)control).RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
                                if (!Page.IsPostBack)
                                {
                                    ((MCSTreeControl)control).SelectValue = staff.Model.OrganizeCity.ToString();
                                }
                            }

                            #endregion
                        }
                        else
                        {
                            ((MCSTreeControl)control).TableName        = RelationTableName;
                            ((MCSTreeControl)control).IDColumnName     = RelationValueField;
                            ((MCSTreeControl)control).NameColumnName   = RelationTextField;
                            ((MCSTreeControl)control).ParentColumnName = "SuperID";
                        }
                    }
                    break;
                }
                #endregion

                control.ID      = "C_" + _dataobject.Name.ToString();
                control.Enabled = _dataobject.Enable.ToUpper() == "Y";
                control.ToolTip = _dataobject.Description;
                if (_dataobject.ControlWidth > 0)
                {
                    control.Width = _dataobject.ControlWidth;
                }

                tc_control.Controls.Add(control);

                #region 如果是文本框时,加上输入验证控件
                if (_dataobject.IsRequireField == "Y")
                {
                    Label lbl_reqinfo = new Label();
                    lbl_reqinfo.Text      = "*";
                    lbl_reqinfo.ForeColor = System.Drawing.Color.Red;
                    tc_control.Controls.Add(lbl_reqinfo);
                }
                //add validate control for the textbox

                if (_dataobject.ControlType == 2 || _dataobject.ControlType == 5)
                {
                    RequiredFieldValidator     _requiredfieldvalidator     = null;
                    CompareValidator           _comparevalidator           = null;
                    RegularExpressionValidator _regularexpressionvalidator = null;
                    if (_dataobject.IsRequireField == "Y")
                    {
                        _requiredfieldvalidator = new RequiredFieldValidator();
                        _requiredfieldvalidator.ControlToValidate = control.ID;
                        _requiredfieldvalidator.Display           = ValidatorDisplay.Dynamic;
                        _requiredfieldvalidator.ErrorMessage      = "必填";
                        _requiredfieldvalidator.ForeColor         = System.Drawing.Color.Red;
                        _requiredfieldvalidator.ValidationGroup   = _validationgroup;

                        tc_control.Controls.Add(_requiredfieldvalidator);
                    }

                    if (_dataobject.DataType == 1 || _dataobject.DataType == 2 || _dataobject.DataType == 4)        //非varchar 字符串
                    {
                        _comparevalidator = new CompareValidator();
                        _comparevalidator.ControlToValidate = control.ID;
                        _comparevalidator.Operator          = ValidationCompareOperator.DataTypeCheck;
                        _comparevalidator.Display           = ValidatorDisplay.Dynamic;
                        _comparevalidator.ForeColor         = System.Drawing.Color.Red;
                        _comparevalidator.ValidationGroup   = _validationgroup;

                        if (_dataobject.DataType == 1)//int
                        {
                            _comparevalidator.Type         = ValidationDataType.Integer;
                            _comparevalidator.ErrorMessage = "应为整数";
                        }
                        if (_dataobject.DataType == 2)//decimal
                        {
                            _comparevalidator.Type         = ValidationDataType.Double;
                            _comparevalidator.ErrorMessage = "应为数字";
                        }
                        if (_dataobject.DataType == 4)//datetime
                        {
                            _comparevalidator.Type         = ValidationDataType.Date;
                            _comparevalidator.ErrorMessage = "日期格式不正确";
                        }
                        tc_control.Controls.Add(_comparevalidator);
                    }
                    else
                    {
                        if (_dataobject.RegularExpression != "")
                        {
                            _regularexpressionvalidator = new RegularExpressionValidator();
                            _regularexpressionvalidator.ControlToValidate    = control.ID;
                            _regularexpressionvalidator.ErrorMessage         = "数据格式不正确";
                            _regularexpressionvalidator.ForeColor            = System.Drawing.Color.Red;
                            _regularexpressionvalidator.ValidationExpression = _dataobject.RegularExpression;
                            _regularexpressionvalidator.ValidationGroup      = ValidationGroup;
                            _regularexpressionvalidator.Display = ValidatorDisplay.Dynamic;
                            tc_control.Controls.Add(_regularexpressionvalidator);
                        }
                    }
                }
                #endregion

                tr_panel_detail.Cells.Add(tc_control);
                #endregion

                #region Record the info of the control created
                DataObjectControlInfo dataobjectcontrolinfo = new DataObjectControlInfo();

                dataobjectcontrolinfo.ControlName    = control.ID;
                dataobjectcontrolinfo.ControlType    = _dataobject.ControlType;
                dataobjectcontrolinfo.DataObjectID   = _dataobject.ID;
                dataobjectcontrolinfo.DataObjectName = _dataobject.Name;
                _htDataObjectdControlsInfo.Add(dataobjectcontrolinfo.DataObjectName, dataobjectcontrolinfo);
                #endregion
            }
            #endregion

            ViewState["HTDataObjectControlInfo"] = _htDataObjectdControlsInfo;

            if (new EWF_Flow_AppBLL(App).Model.RelateBusiness.ToUpper() == "Y")
            {
                SetPanelEnable(false);
            }
        }
    private void BindGrid()
    {
        EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);
        lb_AppName.Text = app.Model.Name;

        lb_AppName.NavigateUrl = "FlowAppDetail.aspx?AppID='" + app.Model.ID.ToString() + "'";

        gv_List.BindGrid<EWF_Flow_Process>(app.GetProcessList());
    }
    private void BindDropDown()
    {
        // 默认下一环节
        EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);
        lb_AppName.Text = app.Model.Name;

        ddl_DefaultNextProcess.DataSource = app.GetProcessList();
        ddl_DefaultNextProcess.DataBind();
        ddl_DefaultNextProcess.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        ddl_Type.DataSource = DictionaryBLL.GetDicCollections("EWF_Flow_ProcessType");
        ddl_Type.DataBind();
        ddl_Type.SelectedValue = "7";

        ddl_DataObject_Position.DataSource = app.GetDataObjectList();
        ddl_DataObject_Position.DataBind();
        ddl_DataObject_Position.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));
    }
    private void BindDropDown()
    {
        EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);
        lb_AppName.Text = app.Model.Name;

        // 默认下一环节
        ddl_DefaultNextProcess.DataSource = app.GetProcessList();
        ddl_DefaultNextProcess.DataBind();
        ddl_DefaultNextProcess.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        //环节类型
        ddl_Type.DataSource = DictionaryBLL.GetDicCollections("EWF_Flow_ProcessType");
        ddl_Type.DataBind();
        this.ddl_Type.SelectedValue = "10";

        ddl_PositiveNextProcess.DataSource = app.GetProcessList();
        ddl_PositiveNextProcess.DataBind();
        ddl_PositiveNextProcess.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        ddl_NegativeNextProcess.DataSource = app.GetProcessList();
        ddl_NegativeNextProcess.DataBind();
        ddl_NegativeNextProcess.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        ddl_RecipientRole_Decision.DataSource = EWF_RoleBLL.GetModelList("");
        ddl_RecipientRole_Decision.DataBind();
        ddl_RecipientRole_Decision.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));

        ddl_DataObject_Decision.DataSource = app.GetDataObjectList();
        ddl_DataObject_Decision.DataBind();
        ddl_DataObject_Decision.Items.Insert(0, new ListItem("请选择...", Guid.Empty.ToString()));
    }
    private void BindData()
    {
        EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);

        if (app.Model != null)
        {
            #region 绑定基本信息
            lb_ID.Text = app.Model.ID.ToString();
            tbx_Name.Text = app.Model.Name;
            tbx_Code.Text = app.Model.Code;
            tbx_Description.Text = app.Model.Description;
            lbl_InsertSatff.Text = app.Model.InsertStaff == 0 ? "" : new Org_StaffBLL(app.Model.InsertStaff).Model.RealName;
            if (app.Model.InsertTime != new DateTime(1900, 1, 1)) lbl_InsertTime.Text = app.Model.InsertTime.ToShortDateString();
            tbx_Remark.Text = app.Model.Remark;
            lbl_UpdateStaff.Text = app.Model.UpdateStaff == 0 ? "" : new Org_StaffBLL(app.Model.UpdateStaff).Model.RealName;
            if (app.Model.UpdateTime != new DateTime(1900, 1, 1)) lbl_UpdateTime.Text = app.Model.UpdateTime.ToShortDateString();
            ddl_EnableFlag.SelectedValue = app.Model.EnableFlag;

            rbl_CanBatchApprove.SelectedValue = app.Model["CanBatchApprove"] == "Y" ? "Y" : "N";

            ddl_RelateDataObject.SelectedValue = app.Model["RelateDataObject"];
            tbx_RelateURL.Text = app.Model["RelateUrl"];

            if (tbx_RelateURL.Text == "")
                ddl_RelateObject.SelectedValue = "NULL";
            else if (ddl_RelateObject.Items.FindByValue(tbx_RelateURL.Text) != null)
            {
                ddl_RelateObject.SelectedItem.Selected = false;
                ddl_RelateObject.Items.FindByValue(tbx_RelateURL.Text).Selected = true;
            }
            else
                ddl_RelateObject.SelectedValue = "UserDefined";
            ddl_RelateObject_SelectedIndexChanged(null, null);
            #endregion
        }
    }