コード例 #1
0
        /// <summary>
        /// 提交按钮处理事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void SubmitBtn_Click(object sender, EventArgs e)
        {
            try
            {
                //提交动作
                string strActionName = ((Button)sender).Text.Trim();
                base.SubAction = strActionName;

                string strErrorMessage = string.Empty;

                //保存
                if (strActionName == ProcessConstString.SubmitAction.ACTION_SAVE_DRAFT)
                {
                    B_DJGTSend entity = ControlToEntity(true) as B_DJGTSend;
                    entity.SubmitAction = strActionName;
                    base.FormSubmit(true, strActionName, null, entity);
                }
                else
                {
                    B_DJGTSend entity = ControlToEntity(false) as B_DJGTSend;
                    entity.SubmitAction = strActionName;

                    //撤销
                    if (strActionName == ProcessConstString.SubmitAction.ACTION_CANCEL)
                    {
                        base.FormCancel(entity);
                    }
                    else
                    {
                        //返回验证提示和流程提示
                        entity.GetSubmitMessage(base.StepName, strActionName, ref strErrorMessage);
                        if (!string.IsNullOrEmpty(strErrorMessage))
                        {
                            JScript.ShowMsgBox(this.Page, strErrorMessage, false);
                            return;
                        }
                        else
                        {
                            switch (base.SubAction)
                            {
                                case ProcessConstString.SubmitAction.CompanySendAction.ACTION_TJJD:
                                    B_DocumentNo_SN sn = new B_DocumentNo_SN();
                                    if (!sn.UpdateNo(ProcessConstString.TemplateName.DJGT_Send, entity.ProcessID, entity.DocumentYear, entity.DocumentNum, entity.DocumentNo))
                                    {
                                        return;
                                    }
                                    break;

                                case ProcessConstString.SubmitAction.CompanySendAction.ACTION_WCGD:
                                    if (!string.IsNullOrEmpty(entity.CirculateDeptIDs) || !string.IsNullOrEmpty(entity.CirculateLeaderIDs))
                                    {
                                        base.Circulate(entity.CirculateDeptIDs, "1", string.Empty, entity.CirculateLeaderIDs, "1", false, string.Empty, false);
                                    }

                                    //党纪工团归档
                                    try
                                    {
                                        string strMessage = string.Empty;
                                        this.Devolve(out strMessage);
                                        base.Devolved(base.ProcessID, base.TemplateName);
                                        JScript.Alert("归档成功!\\n流水号:" + strMessage, false);
                                    }
                                    catch (Exception ex)
                                    {
                                        base.WriteLog(ex.Message);
                                        JScript.Alert("归档失败!请查看配置是否正确!", false);
                                        return;
                                    }
                                    break;
                            }

                            //调用工作流
                            Hashtable nValues = entity.GetProcNameValue(base.StepName, strActionName);
                            base.FormSubmit(false, strActionName, nValues, entity);
                        }

                    }
                }
            }
            catch (Exception ex)
            {
                JScript.ShowMsgBox(this.Page, ex.Message, false);
            }
        }
コード例 #2
0
        /// <summary>
        /// 实体加载
        /// </summary>
        protected override void EntityToControl()
        {
            B_DJGTSend entity = base.EntityData != null ? base.EntityData as B_DJGTSend : new B_DJGTSend();

            ucAttachment.UCDataList = entity.FileList;

            //提示信息
            this.txtMyPrompt.Text = entity.MyPrompt;
            this.txtAllPrompt.Text = entity.Prompt;

            //是否核稿退回
            this.wfIsDeny.Text = entity.IsCheckDraftBack.ToString();

            FormsMethod.SetDropDownList(this.ddlCheckDrafter, entity.CheckDrafterID, entity.CheckDrafter);
            FormsMethod.SetDropDownList(this.ddlHostDept, entity.HostDeptID, entity.HostDept);
            FormsMethod.SetDropDownList(this.ddlSigner, entity.SignerID, entity.Signer);

            this.txtDocumentYear.Text = entity.DocumentYear;
            this.txtDocumentNum.Text = entity.DocumentNum;
            this.txtDocumentNo.Text = entity.DocumentNo;
            this.ddlUrgentDegree.SelectedValue = entity.UrgentDegree;
            this.txtDocumentTitle.Text = entity.DocumentTitle;
            this.txtSubjectWord.Text = entity.SubjectWord;
            this.txtMainSender.Text = entity.MainSenders;
            this.txtCopySender.Text = entity.CopySenders;
            //this.txtPhoneNum.Text = entity.PhoneNum;
            this.txtPhoneNum.Text = string.IsNullOrEmpty(entity.ReceiveUserID) ? CurrentUserInfo.OfficePhone : entity.PhoneNum;
            this.txtShareCount.FSText = entity.ShareCount;
            this.txtSheetCount.FSText = entity.SheetCount;
            this.txtTypist.Text = entity.Typist;
            this.txtChecker.Text = entity.Checker;
            this.txtReChecker.Text = entity.ReChecker;

            //发文日期
            this.txtSendDate.Text = entity.SendDate == DateTime.MinValue ? string.Empty : entity.SendDate.ToString(ConstString.DateFormat.Long);

            //签发日期
            this.txtSignDate.Text = entity.SignDate == DateTime.MinValue ? string.Empty : entity.SignDate.ToString(ConstString.DateFormat.Long);
            this.txtSignCommentView.Text = entity.SignComment;

            //核稿日期
            this.txtSecretaryCheckDate.Text = entity.VerifyDate == DateTime.MinValue ? string.Empty : entity.VerifyDate.ToString(ConstString.DateFormat.Long);

            //审稿日期
            this.txtVerifyDate.Text = entity.CheckDraftDate == DateTime.MinValue ? string.Empty : entity.CheckDraftDate.ToString(ConstString.DateFormat.Long);

            //拟稿日期
            this.txtDraftDate.Text = entity.DraftDate == DateTime.MinValue ? string.Empty : entity.DraftDate.ToString(ConstString.DateFormat.Long);

            //拟稿人
            this.txtDrafter.Text = entity.Drafter;
            this.wfDrafterID.Text = entity.DrafterID;

            //会签部门
            this.txtDeptSigners.Text = entity.IsFormSave ? entity.NewDeptSigners : entity.DeptSigners;
            this.wfDeptSignIDs.Text = entity.IsFormSave ? entity.NewDeptSignerIDs : entity.DeptSignerIDs;

            //公司领导会签
            this.txtLeadSigners.Text = entity.IsFormSave ? entity.NewLeadSigners : entity.LeadSigners;
            this.wfLeaderSignIDs.Text = entity.IsFormSave ? entity.NewLeadSignerIDs : entity.LeadSignerIDs;

            //秘书核稿
            this.txtSecretaryChecker.Text = entity.Verifier;

            //传阅
            this.hDeptID.Value = entity.CirculateDeptIDs;
            this.txtDeptName.Text = entity.CirculateDepts;
            this.hUserID.Value = entity.CirculateLeaderIDs;
            this.txtUserName.Text = entity.CirculateLeaders;

            //发文类型
            this.ddlType.SelectedValue = entity.SendType;

            if (entity != null)
            {
                switch (base.StepName)
                {
                    case ProcessConstString.StepName.STEP_DRAFT:
                        if (!base.IsPreview)
                        {
                            //主办部门
                            OADept.GetDeptByUser(this.ddlHostDept, string.IsNullOrEmpty(entity.ReceiveUserID) ? CurrentUserInfo.UserName : entity.ReceiveUserID, 1, true, false);
                            FormsMethod.SelectedDropDownList(this.ddlHostDept, entity.HostDeptID);
                            FormsMethod.SelectedDropDownList(this.ddlCheckDrafter, entity.CheckDrafterID);
                        }
                        break;

                    case ProcessConstString.StepName.SendStepName.STEP_VERIFY:
                        //签发人
                        if (!base.IsPreview)
                        {
                            OAUser.GetUserByRole(this.ddlSigner, OUConstString.RoleName.PartysLead);
                            FormsMethod.SelectedDropDownList(this.ddlSigner, entity.SignerID);
                        }
                        break;

                    case ProcessConstString.StepName.SendStepName.STEP_DEPT:
                        this.txtCounterSigners.Text = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_DEPT, base.TemplateName);
                        this.txtComment.Text = entity.DeptSignComment;
                        break;

                    case ProcessConstString.StepName.SendStepName.STEP_LEADER:
                        this.txtCounterSigners.Text = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_DEPT, base.TemplateName) +
                        FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_LEADER, base.TemplateName);
                        this.txtComment.Text = entity.LeadSignComment;
                        break;

                    case ProcessConstString.StepName.SendStepName.STEP_SIGN:
                        this.txtDeptSigners.Text = FormsMethod.GetSingers(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_DEPT, base.TemplateName);
                        this.txtLeadSigners.Text = FormsMethod.GetSingers(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_LEADER, base.TemplateName);

                        string sign1 = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_DEPT, base.TemplateName);
                        string sign2 = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_LEADER, base.TemplateName);
                        string sign3 = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_SIGN, base.TemplateName);
                        this.txtCounterSigners.Text = sign1 + "\n" + sign2 + "\n" + sign3;
                        this.txtComment.Text = entity.SignComment;
                        break;

                    case ProcessConstString.StepName.SendStepName.STEP_DISTRIBUTE:
                        //预设发文号
                        if (!base.IsPreview)
                        {
                            if (entity.IsHaveChecked == false)
                            {
                                B_DocumentNo_SN sn = new B_DocumentNo_SN();
                                this.txtDocumentYear.Text = DateTime.Now.Year.ToString();
                                this.txtDocumentNum.Text = sn.GetNo(base.TemplateName);
                                this.txtDocumentNo.Text = "海核发〔" + DateTime.Now.Year.ToString() + "〕" + this.txtDocumentNum.Text + "号";
                            }
                            else
                            {
                                this.txtDocumentYear.Text = entity.DocumentYear;
                                this.txtDocumentNum.Text = entity.DocumentNum;
                                this.txtDocumentNo.Text = entity.DocumentNo;
                            }
                        }

                        this.txtDeptSigners.Text = entity.DeptHaveSigners;
                        this.txtLeadSigners.Text = entity.LeadHaveSigners;
                        break;

                    case ProcessConstString.StepName.SendStepName.STEP_PROOF:
                        this.txtDeptSigners.Text = entity.DeptHaveSigners;
                        this.txtLeadSigners.Text = entity.LeadHaveSigners;
                        break;
                }
            }

            //党群工作处处长处理后显示label形式的处长姓名与时间
            if (entity.SignDate != DateTime.MinValue)
            {
                this.ddlSigner.Visible = false;
                this.txtSignDate.Visible = false;
                this.lbSigner.Visible = true;
                this.lbSignDate.Visible = true;
                this.lbSigner.Text = entity.Signer;
                this.lbSignDate.Text = entity.SignDate.ToString(ConstString.DateFormat.Long);
            }

            //核稿处理后显示label形式的核稿人姓名与时间
            if (entity.VerifyDate != DateTime.MinValue)
            {
                this.txtSecretaryChecker.Visible = false;
                this.txtSecretaryCheckDate.Visible = false;
                this.lbChecker.Visible = true;
                this.lbSecretaryCheckDate.Visible = true;
                this.lbChecker.Text = entity.Verifier;
                this.lbSecretaryCheckDate.Text = entity.VerifyDate.ToString(ConstString.DateFormat.Long);
            }

            //审稿处理后显示label形式的审稿人姓名与时间
            if (entity.CheckDraftDate != DateTime.MinValue)
            {
                this.ddlCheckDrafter.Visible = false;
                this.txtVerifyDate.Visible = false;
                this.lbCheckDrafter.Visible = true;
                this.lbVerifyDate.Visible = true;
                this.lbCheckDrafter.Text = entity.CheckDrafter;
                this.lbVerifyDate.Text = entity.CheckDraftDate.ToString(ConstString.DateFormat.Long);
            }

            //拟稿处理后显示label形式的拟稿人姓名与时间
            if (entity.DraftDate != DateTime.MinValue)
            {
                this.txtDrafter.Visible = false;
                this.txtDraftDate.Visible = false;
                this.lbDrafter.Visible = true;
                this.lbDraftDate.Visible = true;
                this.lbDrafter.Text = entity.Drafter;
                this.lbDraftDate.Text = entity.DraftDate.ToString(ConstString.DateFormat.Long);
            }

            ////校对处理后显示label形式的校对人姓名与时间
            //if (entity.CreateDate != DateTime.MinValue)
            //{
            //    this.txtChecker.Visible = false;
            //    this.lbCChecker.Visible = true;
            //    this.lbCChecker.Text = entity.Checker + strNewLine + entity.CreateDate;
            //}
        }
コード例 #3
0
        /// <summary>
        /// 实体加载
        /// </summary>
        protected override void EntityToControl()
        {
            B_DJGTSend entity = base.EntityData != null ? base.EntityData as B_DJGTSend : new B_DJGTSend();

            ucAttachment.UCDataList = entity.FileList;

            //提示信息
            this.txtMyPrompt.Text  = entity.MyPrompt;
            this.txtAllPrompt.Text = entity.Prompt;

            //是否核稿退回
            this.wfIsDeny.Text = entity.IsCheckDraftBack.ToString();

            FormsMethod.SetDropDownList(this.ddlCheckDrafter, entity.CheckDrafterID, entity.CheckDrafter);
            FormsMethod.SetDropDownList(this.ddlHostDept, entity.HostDeptID, entity.HostDept);
            FormsMethod.SetDropDownList(this.ddlSigner, entity.SignerID, entity.Signer);

            this.txtDocumentYear.Text          = entity.DocumentYear;
            this.txtDocumentNum.Text           = entity.DocumentNum;
            this.txtDocumentNo.Text            = entity.DocumentNo;
            this.ddlUrgentDegree.SelectedValue = entity.UrgentDegree;
            this.txtDocumentTitle.Text         = entity.DocumentTitle;
            this.txtSubjectWord.Text           = entity.SubjectWord;
            this.txtMainSender.Text            = entity.MainSenders;
            this.txtCopySender.Text            = entity.CopySenders;
            //this.txtPhoneNum.Text = entity.PhoneNum;
            this.txtPhoneNum.Text     = string.IsNullOrEmpty(entity.ReceiveUserID) ? CurrentUserInfo.OfficePhone : entity.PhoneNum;
            this.txtShareCount.FSText = entity.ShareCount;
            this.txtSheetCount.FSText = entity.SheetCount;
            this.txtTypist.Text       = entity.Typist;
            this.txtChecker.Text      = entity.Checker;
            this.txtReChecker.Text    = entity.ReChecker;

            //发文日期
            this.txtSendDate.Text = entity.SendDate == DateTime.MinValue ? string.Empty : entity.SendDate.ToString(ConstString.DateFormat.Long);

            //签发日期
            this.txtSignDate.Text        = entity.SignDate == DateTime.MinValue ? string.Empty : entity.SignDate.ToString(ConstString.DateFormat.Long);
            this.txtSignCommentView.Text = entity.SignComment;

            //核稿日期
            this.txtSecretaryCheckDate.Text = entity.VerifyDate == DateTime.MinValue ? string.Empty : entity.VerifyDate.ToString(ConstString.DateFormat.Long);

            //审稿日期
            this.txtVerifyDate.Text = entity.CheckDraftDate == DateTime.MinValue ? string.Empty : entity.CheckDraftDate.ToString(ConstString.DateFormat.Long);

            //拟稿日期
            this.txtDraftDate.Text = entity.DraftDate == DateTime.MinValue ? string.Empty : entity.DraftDate.ToString(ConstString.DateFormat.Long);

            //拟稿人
            this.txtDrafter.Text  = entity.Drafter;
            this.wfDrafterID.Text = entity.DrafterID;

            //会签部门
            this.txtDeptSigners.Text = entity.IsFormSave ? entity.NewDeptSigners : entity.DeptSigners;
            this.wfDeptSignIDs.Text  = entity.IsFormSave ? entity.NewDeptSignerIDs : entity.DeptSignerIDs;

            //公司领导会签
            this.txtLeadSigners.Text  = entity.IsFormSave ? entity.NewLeadSigners : entity.LeadSigners;
            this.wfLeaderSignIDs.Text = entity.IsFormSave ? entity.NewLeadSignerIDs : entity.LeadSignerIDs;

            //秘书核稿
            this.txtSecretaryChecker.Text = entity.Verifier;

            //传阅
            this.hDeptID.Value    = entity.CirculateDeptIDs;
            this.txtDeptName.Text = entity.CirculateDepts;
            this.hUserID.Value    = entity.CirculateLeaderIDs;
            this.txtUserName.Text = entity.CirculateLeaders;

            //发文类型
            this.ddlType.SelectedValue = entity.SendType;

            if (entity != null)
            {
                switch (base.StepName)
                {
                case ProcessConstString.StepName.STEP_DRAFT:
                    if (!base.IsPreview)
                    {
                        //主办部门
                        OADept.GetDeptByUser(this.ddlHostDept, string.IsNullOrEmpty(entity.ReceiveUserID) ? CurrentUserInfo.UserName : entity.ReceiveUserID, 1, true, false);
                        FormsMethod.SelectedDropDownList(this.ddlHostDept, entity.HostDeptID);
                        FormsMethod.SelectedDropDownList(this.ddlCheckDrafter, entity.CheckDrafterID);
                    }
                    break;

                case ProcessConstString.StepName.SendStepName.STEP_VERIFY:
                    //签发人
                    if (!base.IsPreview)
                    {
                        OAUser.GetUserByRole(this.ddlSigner, OUConstString.RoleName.PartysLead);
                        FormsMethod.SelectedDropDownList(this.ddlSigner, entity.SignerID);
                    }
                    break;

                case ProcessConstString.StepName.SendStepName.STEP_DEPT:
                    this.txtCounterSigners.Text = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_DEPT, base.TemplateName);
                    this.txtComment.Text        = entity.DeptSignComment;
                    break;

                case ProcessConstString.StepName.SendStepName.STEP_LEADER:
                    this.txtCounterSigners.Text = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_DEPT, base.TemplateName) +
                                                  FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_LEADER, base.TemplateName);
                    this.txtComment.Text = entity.LeadSignComment;
                    break;

                case ProcessConstString.StepName.SendStepName.STEP_SIGN:
                    this.txtDeptSigners.Text = FormsMethod.GetSingers(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_DEPT, base.TemplateName);
                    this.txtLeadSigners.Text = FormsMethod.GetSingers(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_LEADER, base.TemplateName);

                    string sign1 = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_DEPT, base.TemplateName);
                    string sign2 = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_LEADER, base.TemplateName);
                    string sign3 = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_SIGN, base.TemplateName);
                    this.txtCounterSigners.Text = sign1 + "\n" + sign2 + "\n" + sign3;
                    this.txtComment.Text        = entity.SignComment;
                    break;

                case ProcessConstString.StepName.SendStepName.STEP_DISTRIBUTE:
                    //预设发文号
                    if (!base.IsPreview)
                    {
                        if (entity.IsHaveChecked == false)
                        {
                            B_DocumentNo_SN sn = new B_DocumentNo_SN();
                            this.txtDocumentYear.Text = DateTime.Now.Year.ToString();
                            this.txtDocumentNum.Text  = sn.GetNo(base.TemplateName);
                            this.txtDocumentNo.Text   = "海核发〔" + DateTime.Now.Year.ToString() + "〕" + this.txtDocumentNum.Text + "号";
                        }
                        else
                        {
                            this.txtDocumentYear.Text = entity.DocumentYear;
                            this.txtDocumentNum.Text  = entity.DocumentNum;
                            this.txtDocumentNo.Text   = entity.DocumentNo;
                        }
                    }

                    this.txtDeptSigners.Text = entity.DeptHaveSigners;
                    this.txtLeadSigners.Text = entity.LeadHaveSigners;
                    break;

                case ProcessConstString.StepName.SendStepName.STEP_PROOF:
                    this.txtDeptSigners.Text = entity.DeptHaveSigners;
                    this.txtLeadSigners.Text = entity.LeadHaveSigners;
                    break;
                }
            }

            //党群工作处处长处理后显示label形式的处长姓名与时间
            if (entity.SignDate != DateTime.MinValue)
            {
                this.ddlSigner.Visible   = false;
                this.txtSignDate.Visible = false;
                this.lbSigner.Visible    = true;
                this.lbSignDate.Visible  = true;
                this.lbSigner.Text       = entity.Signer;
                this.lbSignDate.Text     = entity.SignDate.ToString(ConstString.DateFormat.Long);
            }

            //核稿处理后显示label形式的核稿人姓名与时间
            if (entity.VerifyDate != DateTime.MinValue)
            {
                this.txtSecretaryChecker.Visible   = false;
                this.txtSecretaryCheckDate.Visible = false;
                this.lbChecker.Visible             = true;
                this.lbSecretaryCheckDate.Visible  = true;
                this.lbChecker.Text            = entity.Verifier;
                this.lbSecretaryCheckDate.Text = entity.VerifyDate.ToString(ConstString.DateFormat.Long);
            }

            //审稿处理后显示label形式的审稿人姓名与时间
            if (entity.CheckDraftDate != DateTime.MinValue)
            {
                this.ddlCheckDrafter.Visible = false;
                this.txtVerifyDate.Visible   = false;
                this.lbCheckDrafter.Visible  = true;
                this.lbVerifyDate.Visible    = true;
                this.lbCheckDrafter.Text     = entity.CheckDrafter;
                this.lbVerifyDate.Text       = entity.CheckDraftDate.ToString(ConstString.DateFormat.Long);
            }

            //拟稿处理后显示label形式的拟稿人姓名与时间
            if (entity.DraftDate != DateTime.MinValue)
            {
                this.txtDrafter.Visible   = false;
                this.txtDraftDate.Visible = false;
                this.lbDrafter.Visible    = true;
                this.lbDraftDate.Visible  = true;
                this.lbDrafter.Text       = entity.Drafter;
                this.lbDraftDate.Text     = entity.DraftDate.ToString(ConstString.DateFormat.Long);
            }

            ////校对处理后显示label形式的校对人姓名与时间
            //if (entity.CreateDate != DateTime.MinValue)
            //{
            //    this.txtChecker.Visible = false;
            //    this.lbCChecker.Visible = true;
            //    this.lbCChecker.Text = entity.Checker + strNewLine + entity.CreateDate;
            //}
        }
コード例 #4
0
        /// <summary>
        /// 提交按钮处理事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void SubmitBtn_Click(object sender, EventArgs e)
        {
            try
            {
                //提交动作
                string strActionName = ((Button)sender).Text.Trim();
                base.SubAction = strActionName;

                string strErrorMessage = string.Empty;

                //保存
                if (strActionName == ProcessConstString.SubmitAction.ACTION_SAVE_DRAFT)
                {
                    B_DJGTSend entity = ControlToEntity(true) as B_DJGTSend;
                    entity.SubmitAction = strActionName;
                    base.FormSubmit(true, strActionName, null, entity);
                }
                else
                {
                    B_DJGTSend entity = ControlToEntity(false) as B_DJGTSend;
                    entity.SubmitAction = strActionName;

                    //撤销
                    if (strActionName == ProcessConstString.SubmitAction.ACTION_CANCEL)
                    {
                        base.FormCancel(entity);
                    }
                    else
                    {
                        //返回验证提示和流程提示
                        entity.GetSubmitMessage(base.StepName, strActionName, ref strErrorMessage);
                        if (!string.IsNullOrEmpty(strErrorMessage))
                        {
                            JScript.ShowMsgBox(this.Page, strErrorMessage, false);
                            return;
                        }
                        else
                        {
                            switch (base.SubAction)
                            {
                            case ProcessConstString.SubmitAction.CompanySendAction.ACTION_TJJD:
                                B_DocumentNo_SN sn = new B_DocumentNo_SN();
                                if (!sn.UpdateNo(ProcessConstString.TemplateName.DJGT_Send, entity.ProcessID, entity.DocumentYear, entity.DocumentNum, entity.DocumentNo))
                                {
                                    return;
                                }
                                break;

                            case ProcessConstString.SubmitAction.CompanySendAction.ACTION_WCGD:
                                if (!string.IsNullOrEmpty(entity.CirculateDeptIDs) || !string.IsNullOrEmpty(entity.CirculateLeaderIDs))
                                {
                                    base.Circulate(entity.CirculateDeptIDs, "1", string.Empty, entity.CirculateLeaderIDs, "1", false, string.Empty, false);
                                }

                                //党纪工团归档
                                try
                                {
                                    string strMessage = string.Empty;
                                    this.Devolve(out strMessage);
                                    base.Devolved(base.ProcessID, base.TemplateName);
                                    JScript.Alert("归档成功!\\n流水号:" + strMessage, false);
                                }
                                catch (Exception ex)
                                {
                                    base.WriteLog(ex.Message);
                                    JScript.Alert("归档失败!请查看配置是否正确!", false);
                                    return;
                                }
                                break;
                            }

                            //调用工作流
                            Hashtable nValues = entity.GetProcNameValue(base.StepName, strActionName);
                            base.FormSubmit(false, strActionName, nValues, entity);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                JScript.ShowMsgBox(this.Page, ex.Message, false);
            }
        }
コード例 #5
0
        /// <summary>
        /// 实体加载
        /// </summary>
        protected override void EntityToControl()
        {
            EntitySend entity = base.EntityData != null ? base.EntityData as EntitySend : new EntitySend();

            ucAttachment.UCDataList = entity.FileList;

            if (entity != null)
            {
                if (base.StepName == ProcessConstString.StepName.STEP_DRAFT && !base.IsPreview)
                {
                    //主办部门
                    OADept.GetDeptByUser(this.ddlHostDept, string.IsNullOrEmpty(entity.ReceiveUserID) ? CurrentUserInfo.UserName : entity.ReceiveUserID, 1, true, false);

                    FormsMethod.SelectedDropDownList(this.ddlHostDept, entity.HostDept);

                    //负责人+处级以上+部门领导
                    if (this.ddlHostDept.Items.Count > 0)
                    {
                        OAUser.GetUserByDeptPost(this.ddlVerifier, this.ddlHostDept.SelectedValue, OUConstString.PostName.FUCHUZHANG, true, true);
                    }
                    FormsMethod.SelectedDropDownList(this.ddlVerifier, entity.CheckDrafterID);
                }
                else
                {
                    FormsMethod.SetDropDownList(this.ddlVerifier, entity.CheckDrafterID, entity.CheckDrafterName);

                    FormsMethod.SetDropDownList(this.ddlHostDept, entity.HostDept, entity.HostDeptName);
                }

                //发文年度、发文序号、发文号
                if (base.StepName == ProcessConstString.StepName.SendStepName.STEP_DISTRIBUTE && !base.IsPreview)
                {
                    //预设发文号
                    if (entity.IsSubmitCheck == false)
                    {
                        B_DocumentNo_SN sn = new B_DocumentNo_SN();
                        this.txtDocumentYear.Text = DateTime.Now.Year.ToString();
                        this.txtDocumentNum.Text = sn.GetNo(base.TemplateName);
                        this.txtDocumentNo.Text = "〔" + DateTime.Now.Year.ToString() + "〕";
                    }
                    else
                    {
                        this.txtDocumentYear.Text = entity.DocumentYear;
                        this.txtDocumentNum.Text = entity.DocumentNum;
                        this.txtDocumentNo.Text = entity.DocumentNo;
                    }
                }
                else
                {
                    this.txtDocumentYear.Text = entity.DocumentYear;
                    this.txtDocumentNum.Text = entity.DocumentNum;
                    this.txtDocumentNo.Text = entity.DocumentNo;
                }

                this.ddlUrgentDegree.SelectedValue = entity.UrgentDegree;

                this.txtDocumentTitle.Text = entity.DocumentTitle;
                this.txtSubjectWord.Text = entity.SubjectWord;
                this.txtMainSender.Text = entity.MainSenders;
                this.txtCopySender.Text = entity.CopySenders;

                //发文日期
                this.txtSendDate.Text = entity.SendDate == DateTime.MinValue ? string.Empty : entity.SendDate.ToString(ConstString.DateFormat.Long);

                //签发日期
                this.txtSignDate.Text = entity.SignDate == DateTime.MinValue ? string.Empty : entity.SignDate.ToString(ConstString.DateFormat.Long);
                this.txtSignCommentView.Text = entity.SignComment;

                //会签部门
                if (entity.IsFormSave)
                {
                    this.txtDeptSigners.Text = entity.NewDeptSigners;
                    this.txtCounterSignDept.Text = entity.NewDeptSIDs;
                    this.txtCounterSignDeptLeaders.Text = entity.NewDeptSignerIDs;
                }
                else
                {
                    this.txtDeptSigners.Text = entity.DeptSigners;
                    this.txtCounterSignDept.Text = entity.DeptSIDs;
                    this.txtCounterSignDeptLeaders.Text = entity.DeptSignerIDs;
                }
                //公司领导会签
                this.txtLeadSigners.Text = entity.IsFormSave ? entity.NewLeadSigners : entity.LeadSigners;
                this.txtComCounterSignLeaders.Text = entity.IsFormSave ? entity.NewLeadSignerIDs : entity.LeadSignerIDs;

                //审稿日期
                this.txtVerifyDate.Text = entity.CheckDate == DateTime.MinValue ? string.Empty : entity.CheckDate.ToString(ConstString.DateFormat.Long);

                this.txtDrafter.Text = entity.Drafter;
                this.txtDraftDate.Text = entity.DraftDate == DateTime.MinValue ? string.Empty : entity.DraftDate.ToString(ConstString.DateFormat.Long);

                //this.txtPhoneNum.Text = entity.PhoneNum;
                this.txtPhoneNum.Text = string.IsNullOrEmpty(entity.ReceiveUserID) ? CurrentUserInfo.OfficePhone : entity.PhoneNum;
                this.txtShareCount.FSText = entity.ShareCount;
                this.txtSheetCount.FSText = entity.SheetCount;
                this.txtTypist.Text = entity.Typist;
                this.txtChecker.Text = entity.Checker;
                this.txtReChecker.Text = entity.ReChecker;

                //是否核稿退回
                this.txtIsDeny.Text = entity.IsHeGaoBack.ToString();

                //会签意见
                if (base.StepName == ProcessConstString.StepName.SendStepName.STEP_DEPT)
                {
                    this.txtCounterSigners.Text = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_DEPT, base.TemplateName);
                    this.txtComment.Text = entity.DeptSignComment;
                }
                else if (base.StepName == ProcessConstString.StepName.SendStepName.STEP_LEADER)
                {
                    this.txtCounterSigners.Text = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_DEPT, base.TemplateName) +
                        FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_LEADER, base.TemplateName);
                    this.txtComment.Text = entity.LeadSignComment;
                }
                else if (base.StepName == ProcessConstString.StepName.SendStepName.STEP_SIGN)
                {
                    this.txtDeptSigners.Text = FormsMethod.GetSingers(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_DEPT, base.TemplateName);
                    this.txtLeadSigners.Text = FormsMethod.GetSingers(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_LEADER, base.TemplateName);

                    string sign1 = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_DEPT, base.TemplateName);
                    string sign2 = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_LEADER, base.TemplateName);
                    string sign3 = FormsMethod.GetHaveSignInfo(base.ProcessID, base.WorkItemID, ProcessConstString.StepName.SendStepName.STEP_SIGN, base.TemplateName);
                    this.txtCounterSigners.Text = sign1 + "\n" + sign2 + "\n" + sign3;
                    this.txtComment.Text = entity.SignComment;
                }
                else
                {
                    this.txtMyPrompt.Text = entity.MyPrompt;
                }

                if (base.StepName == ProcessConstString.StepName.SendStepName.STEP_VERIFY && !base.IsPreview)
                {
                    //签发人
                    OAUser.GetUserByRole(this.ddlSigner, OUConstString.RoleName.COMPANY_LEADER);
                    FormsMethod.SelectedDropDownList(this.ddlSigner, entity.Signer);
                }
                else
                {
                    if (string.IsNullOrEmpty(entity.SignerName))
                    {
                        FormsMethod.SetDropDownList(this.ddlSigner, entity.Signer, OAUser.GetUserName(entity.Signer));
                    }
                    else
                    {
                        FormsMethod.SetDropDownList(this.ddlSigner, entity.Signer, entity.SignerName);
                    }
                }

                if (base.StepName == ProcessConstString.StepName.SendStepName.STEP_DISTRIBUTE ||
                    base.StepName == ProcessConstString.StepName.SendStepName.STEP_PROOF)
                {
                    this.txtDeptSigners.Text = entity.DeptHaveSigners;
                    this.txtLeadSigners.Text = entity.LeadHaveSigners;
                }

                //秘书核稿
                this.txtSecretaryChecker.Text = entity.Verifier;
                this.txtSecretaryCheckDate.Text = entity.VerifyDate == DateTime.MinValue ? string.Empty : entity.VerifyDate.ToString(ConstString.DateFormat.Long);

                //主任核稿
                this.txtDirectorChecker.Text = entity.ZhuRenSigner;
                this.txtDirectorCheckDate.Text = entity.ZhuRenSignDate == DateTime.MinValue ? string.Empty : entity.ZhuRenSignDate.ToString(ConstString.DateFormat.Long);

                //提示信息
                this.txtMyPrompt.Text = entity.MyPrompt;
                this.txtAllPrompt.Text = entity.Prompt;

                //传阅
                this.hDeptID.Value = entity.CirculateIDs;
                this.txtDeptName.Text = entity.CirculateNames;
                this.hUserID.Value = entity.CirculateLeadIDs;
                this.txtUserName.Text = entity.CirculateLeadNames;

                this.hDeptID1.Value = entity.CirculateAddIDs;
                this.txtDeptName1.Text = entity.CirculateAddNames;
                this.hUserID1.Value = entity.CirculateAddLeadIDs;
                this.txtUserName1.Text = entity.CirculateAddLeadNames;

                //审稿后显示label形式的审稿人与时间
                if (entity.CheckDate != DateTime.MinValue)
                {
                    this.ddlVerifier.Visible = false;
                    this.txtVerifyDate.Visible = false;
                    this.lbShenGaoRen.Visible = true;
                    this.lbVerifyDate.Visible = true;
                    this.lbShenGaoRen.Text = entity.CheckDrafterName;
                    this.lbVerifyDate.Text = entity.CheckDate.ToString(ConstString.DateFormat.Long);
                }

                //秘书核稿后显示label形式的秘书与时间
                if (entity.VerifyDate != DateTime.MinValue)
                {
                    this.txtSecretaryChecker.Visible = false;
                    this.txtSecretaryCheckDate.Visible = false;
                    this.lbHeGaoRenMiShu.Visible = true;
                    this.lbSecretaryCheckDate.Visible = true;
                    this.lbHeGaoRenMiShu.Text = entity.Verifier;
                    this.lbSecretaryCheckDate.Text = entity.VerifyDate.ToString(ConstString.DateFormat.Long);
                }

                //主任核稿后显示label形式的主任与时间
                if (entity.ZhuRenSignDate != DateTime.MinValue)
                {
                    this.txtDirectorChecker.Visible = false;
                    this.txtDirectorCheckDate.Visible = false;
                    this.lbHeGaoZhuRen.Visible = true;
                    this.lbHeGaoZhuRenDate.Visible = true;
                    this.lbHeGaoZhuRen.Text = entity.ZhuRenSigner;
                    this.lbHeGaoZhuRenDate.Text = entity.ZhuRenSignDate.ToString(ConstString.DateFormat.Long);
                }

                //拟稿后显示label形式的拟稿人与时间
                if (entity.DraftDate != DateTime.MinValue)
                {
                    this.txtDrafter.Visible = false;
                    this.txtDraftDate.Visible = false;
                    this.lbNiGaoRen.Visible = true;
                    this.lbDraftDate.Visible = true;
                    this.lbNiGaoRen.Text = entity.Drafter;
                    this.lbDraftDate.Text = entity.DraftDate.ToString(ConstString.DateFormat.Long);
                }

                //////校对后显示label形式的校对人与时间
                ////if (entity.CheckDate != DateTime.MinValue)
                ////{
                //    this.txtChecker.Visible = false;
                //    this.lbJiaoDuiRen.Visible = true;
                //    this.lbJiaoDuiRen.Text = entity.Checker + strNewLine + entity.CreateDate.ToString(ConstString.DateFormat.Long);
                //}

                //签发后显示label形式的签发人与时间
                if (entity.SignDate != DateTime.MinValue)
                {
                    //this.ddlSigner.Visible = false;
                    //this.txtSignDate.Visible = false;
                    //this.lbSignDate.Visible = true;
                    //this.lbSigner.Visible = true;
                    this.lbSigner.Text = entity.SignerName;
                    this.lbSignDate.Text = entity.SignDate.ToString(ConstString.DateFormat.Long);
                }

            }
        }