void cmsfc_GetContractTypeTemplateNameByContractTypeInfosCompleted(object sender, GetContractTypeTemplateNameByContractTypeInfosCompletedEventArgs e)
        {
            try
            {
                if (e.Result != null)
                {
                    HasChosenTemplate.Items.Clear();
                    List <T_OA_CONTRACTTEMPLATE> tmpTemplate = e.Result.ToList();
                    T_OA_CONTRACTTEMPLATE        TemplateT   = new T_OA_CONTRACTTEMPLATE();
                    TemplateT.CONTRACTTEMPLATEID   = "";
                    TemplateT.CONTRACTTEMPLATENAME = "请选择";
                    tmpTemplate.Insert(0, TemplateT);

                    foreach (T_OA_CONTRACTTEMPLATE obj in tmpTemplate)
                    {
                        HasChosenTemplate.Items.Add(obj);
                    }
                    HasChosenTemplate.DisplayMemberPath  = "CONTRACTTEMPLATENAME";//类型名称
                    this.HasChosenTemplate.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.SendException("获取合同类型模版Completed事件", "OA", "T_OA_CONTRACTPRINT", "cmsfc_GetContractTypeTemplateNameByContractTypeInfosCompleted", ex, ExceptionLevel.Middle, ExceptionType.Error);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }
        void cmsfc_GetContractTypeTemplateNameByContractTypeInfosCompleted(object sender, GetContractTypeTemplateNameByContractTypeInfosCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        HasChosenTemplate.Items.Clear();
                        List <T_OA_CONTRACTTEMPLATE> tmpTemplate = e.Result.ToList();
                        T_OA_CONTRACTTEMPLATE        TemplateT   = new T_OA_CONTRACTTEMPLATE();
                        TemplateT.CONTRACTTEMPLATEID = "";
                        string dictname = Utility.GetResourceStr("PLEASESELECTL", TemplateT.CONTRACTTEMPLATEID);
                        TemplateT.CONTRACTTEMPLATENAME = dictname;
                        tmpTemplate.Insert(0, TemplateT);

                        foreach (T_OA_CONTRACTTEMPLATE obj in tmpTemplate)
                        {
                            HasChosenTemplate.Items.Add(obj);
                        }
                    }
                    if (HasChosenTemplate.Items.Count > 0)
                    {
                        HasChosenTemplate.SelectedIndex = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.SendException("获取合同模板名称Completed事件", "OA", "T_OA_CONTRACTAPP", "获取合同模版时返回错误", ex, ExceptionLevel.Middle, ExceptionType.Error);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }
示例#3
0
        public ContractTemplates(FormTypes action, V_ContractTemplate TemplageObj)
        {
            InitializeComponent();
            actions      = action;
            this.Loaded += (sender, args) =>
            {
                #region 原来的

                InitEvent();
                if (action != FormTypes.New)
                {
                    InfoObj = TemplageObj.contractTemplate;
                    InfoObj.T_OA_CONTRACTTYPE = new T_OA_CONTRACTTYPE();
                    InfoObj.T_OA_CONTRACTTYPE.CONTRACTTYPEID = TemplageObj.contractType;
                }
                if (action == FormTypes.Browse)
                {
                    tbxContractTypeID.IsEnabled = false;
                    cbContractLevel.IsEnabled   = false;
                    tbxTemplateName.IsReadOnly  = true;
                    tbxContractTitle.IsReadOnly = true;
                    tbxContractText.IsEnabled   = false;
                    this.tbxContractText.GetRichTextbox().IsEnabled = false;
                }
                if (action == FormTypes.Edit || action == FormTypes.Audit || action == FormTypes.Browse)
                {
                    tbxContractText.RichTextBoxContext = InfoObj.CONTENT;
                }
                #endregion
            };
        }
 [OperationContract]//根据模板ID获取模板信息
 public T_OA_CONTRACTTEMPLATE GetContractTemplateById(string contractID)
 {
     using (ContractTemplateBLL ctbll = new ContractTemplateBLL())
     {
         T_OA_CONTRACTTEMPLATE MyContract = ctbll.GetContractTemplateById(contractID);
         return(MyContract == null ? null : MyContract);
     }
 }
示例#5
0
 private void InitEvent()
 {
     ContractManagement = new SmtOADocumentAdminClient();
     InfoObj            = new T_OA_CONTRACTTEMPLATE();
     ContractManagement.GetContractTypeNameInfosToComboxAsync();
     ContractManagement.ContractTemplateAddCompleted              += new EventHandler <ContractTemplateAddCompletedEventArgs>(ctsc_ContractTemplateAddCompleted);                 //添加
     ContractManagement.UpdateContraTemplateCompleted             += new EventHandler <UpdateContraTemplateCompletedEventArgs>(ContractManagement_UpdateContraTemplateCompleted); //修改
     ContractManagement.GetContractTypeNameInfosToComboxCompleted += new EventHandler <GetContractTypeNameInfosToComboxCompletedEventArgs>(cmfc_GetContractTypeNameInfosToComboxCompleted);
 }
        private void HasChosenTemplate_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (HasChosenTemplate.SelectedIndex < 1)
            {
                return;
            }
            T_OA_CONTRACTTEMPLATE TemplageText = new T_OA_CONTRACTTEMPLATE();

            TemplageText = (T_OA_CONTRACTTEMPLATE)HasChosenTemplate.SelectedItem;
            //ContractText.Text = TemplageText.CONTENT;

            //ContractText.RichTextBoxContext = TemplageText.CONTENT;
        }
 [OperationContract]//添加合同模板信息
 public string ContractTemplateAdd(T_OA_CONTRACTTEMPLATE contractTemplate)
 {
     using (ContractTemplateBLL ctbll = new ContractTemplateBLL())
     {
         string returnStr = "";
         if (!ctbll.IsExistContractTemplate(contractTemplate.CONTRACTTEMPLATENAME,
                                            contractTemplate.CREATECOMPANYID, contractTemplate.CONTRACTLEVEL, contractTemplate.CONTRACTTITLE))
         {
             if (!ctbll.ContractTemplateAdd(contractTemplate))
             {
                 returnStr = "添加数据失败";
             }
         }
         else
         {
             returnStr = "合同模板信息已经存在,添加数据失败";
         }
         return(returnStr);
     }
 }
 [OperationContract]//更新模板信息
 public string UpdateContraTemplate(T_OA_CONTRACTTEMPLATE contraTemplateInfo)
 {
     using (ContractTemplateBLL ctbll = new ContractTemplateBLL())
     {
         string returnStr = "";
         if (!ctbll.IsExistContractTemplate(contraTemplateInfo.CONTRACTTEMPLATENAME,
                                            contraTemplateInfo.CREATECOMPANYID, contraTemplateInfo.CONTRACTLEVEL, contraTemplateInfo.CONTRACTTITLE))
         {
             if (!ctbll.UpdateContraTemplate(contraTemplateInfo))
             {
                 returnStr = "更新数据失败!";
             }
         }
         else
         {
             returnStr = "合同模板信息已经存在,更新数据失败";
         }
         return(returnStr);
     }
 }
        private void HasChosenTemplate_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                if (HasChosenTemplate.SelectedIndex < 1)
                {
                    if (actions == FormTypes.New)
                    {
                        //ContractText.GetRichTextbox() = string.Empty;
                        ContractTitle.Text            = string.Empty;
                        cbContractLevel.SelectedIndex = 0;
                        cbContractLevel.IsEnabled     = true;
                        //ContractTitle.IsReadOnly = true;
                    }
                }
                else
                {
                    T_OA_CONTRACTTEMPLATE TemplageText = new T_OA_CONTRACTTEMPLATE();
                    TemplageText = (T_OA_CONTRACTTEMPLATE)HasChosenTemplate.SelectedItem;

                    ContractText.RichTextBoxContext = TemplageText.CONTENT;
                    ContractTitle.Text = TemplageText.CONTRACTTITLE;
                    foreach (T_SYS_DICTIONARY contractLevel in cbContractLevel.Items)
                    {
                        if (contractLevel.DICTIONARYVALUE.ToString() == TemplageText.CONTRACTLEVEL)
                        {
                            cbContractLevel.SelectedItem = contractLevel;
                        }
                    }
                    cbContractLevel.IsEnabled = false;
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.SendException("ComBox选择模板处理事件", "OA", "T_OA_CONTRACTAPP", "选择合同模版返回错误", ex, ExceptionLevel.Middle, ExceptionType.Error);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }
 public ContractTemplateDetailInfos(T_OA_CONTRACTTEMPLATE obj)
 {
     contraTemplate = obj;
     InitializeComponent();
     ShowTemplateDetailInfos();
 }
        private void HasChosenTemplate_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                if (HasChosenTemplate.SelectedIndex < 1)
                {
                    if (actions == FormTypes.New)
                    {
                        //ContractText.GetRichTextbox() = string.Empty;
                        ContractTitle.Text = string.Empty;
                        cbContractLevel.SelectedIndex = 0;
                        cbContractLevel.IsEnabled = true;
                        //ContractTitle.IsReadOnly = true;
                    }
                }
                else
                {
                    T_OA_CONTRACTTEMPLATE TemplageText = new T_OA_CONTRACTTEMPLATE();
                    TemplageText = (T_OA_CONTRACTTEMPLATE)HasChosenTemplate.SelectedItem;

                    ContractText.RichTextBoxContext = TemplageText.CONTENT;
                    ContractTitle.Text = TemplageText.CONTRACTTITLE;
                    foreach (T_SYS_DICTIONARY contractLevel in cbContractLevel.Items)
                    {
                        if (contractLevel.DICTIONARYVALUE.ToString() == TemplageText.CONTRACTLEVEL)
                        {
                            cbContractLevel.SelectedItem = contractLevel;
                        }
                    }
                    cbContractLevel.IsEnabled = false;
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.SendException("ComBox选择模板处理事件", "OA", "T_OA_CONTRACTAPP", "选择合同模版返回错误", ex, ExceptionLevel.Middle, ExceptionType.Error);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }
        void cmsfc_GetContractTypeTemplateNameByContractTypeInfosCompleted(object sender, GetContractTypeTemplateNameByContractTypeInfosCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (e.Result != null)
                    {
                        HasChosenTemplate.Items.Clear();
                        List<T_OA_CONTRACTTEMPLATE> tmpTemplate = e.Result.ToList();
                        T_OA_CONTRACTTEMPLATE TemplateT = new T_OA_CONTRACTTEMPLATE();
                        TemplateT.CONTRACTTEMPLATEID = "";
                        string dictname = Utility.GetResourceStr("PLEASESELECTL", TemplateT.CONTRACTTEMPLATEID);
                        TemplateT.CONTRACTTEMPLATENAME = dictname;
                        tmpTemplate.Insert(0, TemplateT);

                        foreach (T_OA_CONTRACTTEMPLATE obj in tmpTemplate)
                        {
                            HasChosenTemplate.Items.Add(obj);
                        }
                    }
                    if (HasChosenTemplate.Items.Count > 0)
                    {
                        HasChosenTemplate.SelectedIndex = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.SendException("获取合同模板名称Completed事件", "OA", "T_OA_CONTRACTAPP", "获取合同模版时返回错误", ex, ExceptionLevel.Middle, ExceptionType.Error);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }
示例#13
0
 [OperationContract]//添加合同模板信息
 public string ContractTemplateAdd(T_OA_CONTRACTTEMPLATE contractTemplate)
 {
     using (ContractTemplateBLL ctbll = new ContractTemplateBLL())
     {
         string returnStr = "";
         if (!ctbll.IsExistContractTemplate(contractTemplate.CONTRACTTEMPLATENAME,
             contractTemplate.CREATECOMPANYID, contractTemplate.CONTRACTLEVEL, contractTemplate.CONTRACTTITLE))
         {
             if (!ctbll.ContractTemplateAdd(contractTemplate))
             {
                 returnStr = "添加数据失败";
             }
         }
         else
         {
             returnStr = "合同模板信息已经存在,添加数据失败";
         }
         return returnStr;
     }
 }
示例#14
0
 [OperationContract]//更新模板信息
 public string UpdateContraTemplate(T_OA_CONTRACTTEMPLATE contraTemplateInfo)
 {
     using (ContractTemplateBLL ctbll = new ContractTemplateBLL())
     {
         string returnStr = "";
         if (!ctbll.IsExistContractTemplate(contraTemplateInfo.CONTRACTTEMPLATENAME,
             contraTemplateInfo.CREATECOMPANYID, contraTemplateInfo.CONTRACTLEVEL, contraTemplateInfo.CONTRACTTITLE))
         {
             if (!ctbll.UpdateContraTemplate(contraTemplateInfo))
             {
                 returnStr = "更新数据失败!";
             }
         }
         else
         {
             returnStr = "合同模板信息已经存在,更新数据失败";
         }
         return returnStr;
     }
 }
 public ContractTemplateDetailInfos(T_OA_CONTRACTTEMPLATE obj)
 {
     contraTemplate = obj;
     InitializeComponent();
     ShowTemplateDetailInfos();
 }