コード例 #1
0
        void cmsfc_GetContractApprovalByIdCompleted(object sender, GetContractApprovalByIdCompletedEventArgs e)
        {
            try
            {
                if (e.Error != null && !string.IsNullOrEmpty(e.Error.Message))
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message);
                }
                else
                {
                    if (e.Result == null)
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTFOUND"));
                        return;
                    }
                    else
                    {
                        CtappObj = e.Result.contractApp;
                        if (actions == FormTypes.Resubmit)//重新提交
                        {
                            CtappObj.CHECKSTATE = (Convert.ToInt32(CheckStates.UnSubmit)).ToString();
                        }
                        if (actions != FormTypes.New)
                        {
                            strContactType = e.Result.contractApp.CONTRACTTYPEID;
                        }
                        //if (actions == FormTypes.Audit)
                        //{
                        //    audit.XmlObject = DataObjectToXml<T_OA_CONTRACTAPP>.ObjListToXml(CtappObj, "OA");
                        //}
                        if (actions == FormTypes.Edit || actions == FormTypes.Audit
                                  || actions == FormTypes.Browse)
                        {
                            if (CtappObj != null)
                            {
                                switch (CtappObj.CONTRACTFLAG)//申请标志
                                {
                                    case "0":
                                        this.rbtYes.IsChecked = true;//商务合同
                                        break;
                                    case "1":
                                        this.RbtNo.IsChecked = true;//人事合同
                                        break;
                                }
                                this.StartTime.Text = Convert.ToDateTime(CtappObj.STARTDATE).ToShortDateString();
                                this.EndTime.Text = Convert.ToDateTime(CtappObj.ENDDATE).ToShortDateString();
                                this.nudBalanceMonth.Value = Convert.ToInt32(CtappObj.EXPIRATIONREMINDER);//到期提醒天数                                
                                ContractText.RichTextBoxContext = ctappObj.CONTENT;//合同内容
                                this.HasChosenTemplate.IsEnabled = false;
                                this.cbContractLevel.IsEnabled = false;

                                Party.Add(CtappObj.PARTYA);
                                Party.Add(CtappObj.PARTYB);
                                personclient.GetEmployeeByIDsAsync(Party);

                            }
                        }
                        //InitAudit();//审批
                        RefreshUI(RefreshedTypes.AuditInfo);
                        RefreshUI(RefreshedTypes.All);
                        cmsfc.GetContractTypeNameInfosToComboxAsync();
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.Message.ToString());
            }
        }
コード例 #2
0
        void cmsfc_GetContractApprovalByIdCompleted(object sender, GetContractApprovalByIdCompletedEventArgs e)
        {
            try
            {
                if (e.Error != null && !string.IsNullOrEmpty(e.Error.Message))
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message);
                }
                else
                {
                    if (e.Result == null)
                    {
                        Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTFOUND"));
                        return;
                    }
                    else
                    {
                        CtappObj = e.Result.contractApp;
                        if (actions == FormTypes.Resubmit)//重新提交
                        {
                            CtappObj.CHECKSTATE = (Convert.ToInt32(CheckStates.UnSubmit)).ToString();
                        }
                        if (actions != FormTypes.New)
                        {
                            strContactType = e.Result.contractApp.CONTRACTTYPEID;
                        }
                        //if (actions == FormTypes.Audit)
                        //{
                        //    audit.XmlObject = DataObjectToXml<T_OA_CONTRACTAPP>.ObjListToXml(CtappObj, "OA");
                        //}
                        if (actions == FormTypes.Edit || actions == FormTypes.Audit ||
                            actions == FormTypes.Browse)
                        {
                            if (CtappObj != null)
                            {
                                switch (CtappObj.CONTRACTFLAG)//申请标志
                                {
                                case "0":
                                    this.rbtYes.IsChecked = true;    //商务合同
                                    break;

                                case "1":
                                    this.RbtNo.IsChecked = true;    //人事合同
                                    break;
                                }
                                this.StartTime.Text              = Convert.ToDateTime(CtappObj.STARTDATE).ToShortDateString();
                                this.EndTime.Text                = Convert.ToDateTime(CtappObj.ENDDATE).ToShortDateString();
                                this.nudBalanceMonth.Value       = Convert.ToInt32(CtappObj.EXPIRATIONREMINDER); //到期提醒天数
                                ContractText.RichTextBoxContext  = ctappObj.CONTENT;                             //合同内容
                                this.HasChosenTemplate.IsEnabled = false;
                                this.cbContractLevel.IsEnabled   = false;

                                Party.Add(CtappObj.PARTYA);
                                Party.Add(CtappObj.PARTYB);
                                personclient.GetEmployeeByIDsAsync(Party);
                            }
                        }
                        //InitAudit();//审批
                        RefreshUI(RefreshedTypes.AuditInfo);
                        RefreshUI(RefreshedTypes.All);
                        cmsfc.GetContractTypeNameInfosToComboxAsync();
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.Message.ToString());
            }
        }