Пример #1
0
 private void InitForm()
 {
     if (!string.IsNullOrEmpty(Request.QueryString["id"]))
     {
         SystemDispatchInfo info = SystemDispatch.GetSystemDispatchInfo(FormId);
         cblSecurityLevel.SelectedIndex = Convert.ToInt32(info.SecurityLevel);
         cblUrgenLevel.SelectedIndex    = Convert.ToInt32(info.UrgenLevel);
         UpdatedTextBox.Value           = info.DateTime;
         tbDateTime.Text = info.DateTime;
         tbUserName.Text = info.UserName;
         tbMobile.Text   = info.Mobile;
         tbTitle.Text    = info.Title;
         tbContent.Text  = info.Content;
         cblRedHeadDocument.SelectedIndex = int.Parse(info.RedHeadDocument);
         cblIsPublish.SelectedIndex       = int.Parse(info.IsPublish);
         cblSecurityLevel.SelectedIndex   = int.Parse(info.SecurityLevel);
         cblUrgenLevel.SelectedIndex      = int.Parse(info.UrgenLevel);
         tbReportCode.Text = info.FormId;
     }
     else
     {
         tbUserName.Text      = _BPMContext.CurrentPWordUser.EmployeeName;
         tbMobile.Text        = _BPMContext.CurrentPWordUser.MobilePhone;
         UpdatedTextBox.Value = DateTime.Now.ToString("yyyy/MM/dd");
     }
 }
Пример #2
0
    /// <summary>
    /// 加载发起部门及相关控件
    /// </summary>
    private void InitFormData()
    {
        try
        {
            SystemDispatchInfo formDataInfo = SystemDispatch.GetSystemDispatchInfo(FormId);

            ListItem item = ddlDepartName.Items.FindByValue(formDataInfo.StartDeptId);
            if (item != null)
            {
                ddlDepartName.SelectedIndex = ddlDepartName.Items.IndexOf(item);
            }
            ListItem departItem = ddlDepartName.Items.FindByValue(formDataInfo.StartDeptId);
            if (departItem == null)
            {
                ExceptionHander.GoToErrorPage();
                return;
            }
            departItem.Selected            = true;
            Countersign1.CounterSignDeptId = formDataInfo.StartDeptId;
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #3
0
 /// <summary>
 /// 加载表单
 /// </summary>
 private void InitFormData()
 {
     try
     {
         if (!string.IsNullOrEmpty(Request.QueryString["id"]))
         {
             SystemDispatchInfo info = SystemDispatch.GetSystemDispatchInfo(FormId);
             cblSecurityLevel.SelectedIndex = Convert.ToInt32(info.SecurityLevel);
             cblUrgenLevel.SelectedIndex    = Convert.ToInt32(info.UrgenLevel);
             tbDepartName.Text = info.DeptName;
             tbDateTime.Text   = info.DateTime;
             tbDateTime.Text   = info.DateTime;
             tbUserName.Text   = info.UserName;
             tbMobile.Text     = info.Mobile;
             tbTitle.Text      = info.Title;
             tbContent.Text    = info.Content;
             cblRedHeadDocument.SelectedIndex = int.Parse(info.RedHeadDocument);
             cblIsPublish.SelectedIndex       = int.Parse(info.IsPublish);
             cblSecurityLevel.SelectedIndex   = int.Parse(info.SecurityLevel);
             cblUrgenLevel.SelectedIndex      = int.Parse(info.UrgenLevel);
             tbReportCode.Text = info.FormId;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #4
0
    /// <summary>
    /// 初始化总办会成员复选框和董事长勾选框
    /// </summary>
    private void InitCheckBoxList()
    {
        BFPmsUserRoleDepartment bfurd = new BFPmsUserRoleDepartment();
        DataTable dtLeaders           = bfurd.GetSelectRoleUser(PKURGICode, "总办会成员");
        string    strLeaders          = GetRoleUsers(PKURGICode, "总办会成员");

        foreach (DataRow user in dtLeaders.Rows)
        {
            ListItem li = new ListItem();
            li.Value = "K2:Founder\\" + user["LoginName"].ToString();
            li.Text  = user["EmployeeName"].ToString();
            if (!cblTopLeaders.Items.Contains(li))
            {
                cblTopLeaders.Items.Add(li);
            }
        }

        if (!string.IsNullOrEmpty(Request.QueryString["id"]))
        {
            XmlDocument        xmldoc       = new XmlDocument();
            SystemDispatchInfo formDataInfo = SystemDispatch.GetSystemDispatchInfo(FormId);
            if (!string.IsNullOrEmpty(formDataInfo.LeadersSelected))
            {
                xmldoc.LoadXml(formDataInfo.LeadersSelected);
            }

            XmlNode NodeLeaders = xmldoc.SelectSingleNode("//TopLeaders");
            if (NodeLeaders != null && NodeLeaders.Attributes["ID"].Value.Length > 0)
            {
                foreach (string UserGuid in NodeLeaders.Attributes["ID"].Value.Split(','))
                {
                    for (int i = 0; i < cblTopLeaders.Items.Count; i++)
                    {
                        if (cblTopLeaders.Items[i].Value == UserGuid)
                        {
                            cblTopLeaders.Items[i].Selected = true;
                        }
                    }
                }
            }
            XmlNode NodeChairman = xmldoc.SelectSingleNode("//Chairman");
            if (NodeChairman != null && NodeChairman.Attributes["ID"].Value != "noapprovers")
            {
                cbChairman.Checked = true;
            }
        }
        else
        {
            for (int i = 0; i < cblTopLeaders.Items.Count; i++)
            {
                cblTopLeaders.Items[i].Selected = true;
            }
        }
    }
Пример #5
0
    private void InintData()
    {
        string methodName = "InintData";

        try
        {
            WorkFlowInstance   Instance = wf_WorkFlowInstance.GetWorkFlowInstanceById(ViewState["InstanceID"].ToString());
            SystemDispatchInfo info     = SystemDispatch.GetSystemDispatchInfoByInstanceId(ViewState["InstanceID"].ToString());
            if (info != null)
            {
                cblSecurityLevel.SelectedIndex = Convert.ToInt32(info.SecurityLevel);
                cblUrgenLevel.SelectedIndex    = Convert.ToInt32(info.UrgenLevel);
                tbDepartName.Text = info.DeptName;
                tbDateTime.Text   = info.DateTime;
                tbDateTime.Text   = info.DateTime;
                tbUserName.Text   = info.UserName;
                tbMobile.Text     = info.Mobile;
                tbTitle.Text      = info.Title;
                tbContent.Text    = info.Content.Replace(" ", "&nbsp;").Replace("\n", "<br/>");
                cblRedHeadDocument.SelectedIndex = int.Parse(info.RedHeadDocument);
                cblIsPublish.SelectedIndex       = int.Parse(info.IsPublish);
                cblSecurityLevel.SelectedIndex   = int.Parse(info.SecurityLevel);
                cblUrgenLevel.SelectedIndex      = int.Parse(info.UrgenLevel);
                tbReportCode.Text = info.FormId;
            }

            FlowRelated1.ProcId       = ViewState["InstanceID"].ToString();
            Countersign1.ProcId       = ViewState["InstanceID"].ToString();
            UploadAttachments1.ProcId = ViewState["InstanceID"].ToString();

            OpinionDeptleader.InstanceId  = ViewState["InstanceID"].ToString();
            OpinionRealateDept.InstanceId = ViewState["InstanceID"].ToString();
            OpinionTopLeaders.InstanceId  = ViewState["InstanceID"].ToString();
            OpinionCEO.InstanceId         = ViewState["InstanceID"].ToString();
            OpinionChairman.InstanceId    = ViewState["InstanceID"].ToString();
        }
        catch (Exception ex)
        {
            Logger.Write(this.GetType(), EnumLogLevel.Fatal, className + ":" + methodName + ":" + Pkurg.PWorldBPM.Common.Log.MessageType.Exception + ":" + string.Format("Exception={0}", ex));
            throw ex;
        }
        Logger.Write(this.GetType(), EnumLogLevel.Info, className + ":" + methodName + ":" + Pkurg.PWorldBPM.Common.Log.MessageType.OUT);
    }
Пример #6
0
    /// <summary>
    /// 保存表单
    /// </summary>
    /// <returns></returns>
    private SystemDispatchInfo SaveFormData()
    {
        bool isEdit             = false;
        SystemDispatchInfo info = null;

        try
        {
            info = SystemDispatch.GetSystemDispatchInfo(FormId);
            if (info == null)
            {
                info                 = new SystemDispatchInfo();
                info.FormId          = FormId;
                info.StartDeptId     = ddlDepartName.SelectedItem.Value;
                info.DeptName        = ddlDepartName.SelectedItem.Text;
                info.SecurityLevel   = cblSecurityLevel.SelectedIndex.ToString();
                info.UrgenLevel      = cblUrgenLevel.SelectedIndex.ToString();
                FormId               = BPMHelp.GetSerialNumber("OA_ZD_");
                info.FormId          = FormId;
                info.DateTime        = UpdatedTextBox.Value;
                info.UserName        = tbUserName.Text;
                info.Mobile          = tbMobile.Text;
                info.Title           = tbTitle.Text;
                info.IsPublish       = cblIsPublish.SelectedIndex.ToString();
                info.RedHeadDocument = cblRedHeadDocument.SelectedIndex.ToString();
                info.Content         = tbContent.Text;
                info.LeadersSelected = strApprovers;
            }
            else
            {
                isEdit               = true;
                info.FormId          = FormId;
                info.StartDeptId     = ddlDepartName.SelectedItem.Value;
                info.DeptName        = ddlDepartName.SelectedItem.Text;
                info.SecurityLevel   = cblSecurityLevel.SelectedIndex.ToString();
                info.UrgenLevel      = cblUrgenLevel.SelectedIndex.ToString();
                info.FormId          = tbReportCode.Text;
                info.DateTime        = UpdatedTextBox.Value;
                info.UserName        = tbUserName.Text;
                info.Mobile          = tbMobile.Text;
                info.Title           = tbTitle.Text;
                info.IsPublish       = cblIsPublish.SelectedIndex.ToString();
                info.RedHeadDocument = cblRedHeadDocument.SelectedIndex.ToString();
                info.Content         = tbContent.Text;
                info.LeadersSelected = strApprovers;
            }
            if (!isEdit)
            {
                SystemDispatch.InsertSystemDispatchInfo(info);
            }
            else
            {
                SystemDispatch.UpdateSystemDispatch(info);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }

        return(info);
    }