private void InitData() { try { if (actions == FormTypes.New) { CtappObj = new T_OA_CONTRACTAPP(); CtappObj.CHECKSTATE = ((int)CheckStates.UnSubmit).ToString(); this.StartTime.Text = DateTime.Now.ToShortDateString(); this.EndTime.Text = DateTime.Now.ToShortDateString(); } else { if (actions == FormTypes.Audit) { actionFlag = DataActionFlag.SubmitComplete; } cmsfc.GetContractApprovalByIdAsync(ctappID); } } catch (Exception ex) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.Message.ToString()); } }
[OperationContract]//更新申请信息 public string UpdateContraApproval(T_OA_CONTRACTAPP contraApprovalInfo) { using (ContractApprovalBLL cab = new ContractApprovalBLL()) { string returnStr = ""; if (!cab.UpdateContraApproval(contraApprovalInfo)) { returnStr = "更新数据失败!"; } return(returnStr); } }
private void GetContractPrint(V_ContractPrint contractPrint) { if (cprinting != null) { if (!string.IsNullOrEmpty(contractPrint.contractApp.contractApp.CONTRACTTITLE)) { ContractTitle.Text = contractPrint.contractApp.contractApp.CONTRACTTITLE;//标题 } cprinting = contractPrint.contractPrint; ctapp = contractPrint.contractApp.contractApp; ContractID.SelectedText = contractPrint.contractApp.contractApp.CONTRACTCODE; //合同编号 ContractTitle.Text = contractPrint.contractApp.contractApp.CONTRACTTITLE; //标题 } }
void cmsfc_GetContractViewByIdCompleted(object sender, GetContractViewByIdCompletedEventArgs e)//根据查看ID查询 { try { if (e.Error == null) { if (e.Result != null) { ContractViewObj = e.Result; //合同查看申请视图 if (actions == FormTypes.Resubmit) //重新提交 { ContractViewObj.CHECKSTATE = (Convert.ToInt32(CheckStates.UnSubmit)).ToString(); } cprinting = ContractViewObj.T_OA_CONTRACTPRINT; //打印视图 ctapp = ContractViewObj.T_OA_CONTRACTPRINT.T_OA_CONTRACTAPP; ContractID.SelectedText = ctapp.CONTRACTCODE; //合同编号 ContractTitle.Text = ctapp.CONTRACTTITLE; //标题 this.txtCompanyId.Text = Utility.GetCompanyName(ContractViewObj.OWNERCOMPANYID); //所属公司ID this.txtDepartmentId.Text = Utility.GetDepartmentName(ContractViewObj.OWNERDEPARTMENTID); //所属部门ID txtTELL.Text = ContractViewObj.TEL; txtCreateUser.Text = ContractViewObj.OWNERNAME; //if (actions == FormTypes.Audit) //{ // audit.XmlObject = DataObjectToXml<T_OA_CONTRACTVIEW>.ObjListToXml(ContractViewObj, "OA"); //} //InitAudit();//审批 RefreshUI(RefreshedTypes.AuditInfo); RefreshUI(RefreshedTypes.All); //ctrFile.Load_fileData(cprinting.CONTRACTPRINTID); } } else { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message); } } catch (Exception ex) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.ToString()); } }
[OperationContract]//添加合同申请信息 public string ContractApprovalAdd(T_OA_CONTRACTAPP ContractApproval) { using (ContractApprovalBLL cab = new ContractApprovalBLL()) { string returnStr = ""; if (!cab.IsExistContractApproval(ContractApproval.CONTRACTCODE, ContractApproval.CONTRACTTITLE, ContractApproval.CONTRACTTYPEID, ContractApproval.CONTRACTLEVEL)) { if (!cab.ContractApprovalAdd(ContractApproval)) { returnStr = "添加数据失败"; } } else { returnStr = "合同申请信息已经存在,添加数据失败"; } return(returnStr); } }
//#region 根据传回的XML,添加出差报销信息 ///// <summary> ///// 根据传回的XML,添加出差报销信息 ///// </summary> ///// <param name="xele"></param> //private static string TravelReimbursementAdd(IEnumerable<XElement> eGFunc) //{ //} //#endregion #region 根据传回的XML,添加合同申请信息 /// <summary> /// 根据传回的XML,添加合同申请信息 /// </summary> /// <param name="xele"></param> private static string ContractApprovalAdd(IEnumerable<XElement> eGFunc) { try { if (eGFunc.Count() == 0) { return ""; } string strEmployeeID = string.Empty; string strOwnerID = string.Empty; string strOwnerPostID = string.Empty; string strOwnerDepartmentID = string.Empty; string strOwnerCompanyID = string.Empty; string strContRactCode = string.Empty; string strContRactTypeid = string.Empty; string strContRactLevel = string.Empty; string strPartya = string.Empty; string strPartyb = string.Empty; string strStartDate = string.Empty; string strEndDate = string.Empty; string strContRactFlag = string.Empty; string strExpirationReminder = string.Empty; string strContRactTitle = string.Empty; string strContent = string.Empty; string strCheckState = string.Empty; string strTEL = string.Empty; foreach (var q in eGFunc) { string strName = q.Attribute("Name").Value; switch (strName) { case "CREATEUSERID": strEmployeeID = q.Attribute("Value").Value; break; case "OWNERID": strOwnerID = q.Attribute("Value").Value; break; case "OWNERPOSTID": strOwnerPostID = q.Attribute("Value").Value; break; case "OWNERDEPARTMENTID": strOwnerDepartmentID = q.Attribute("Value").Value; break; case "OWNERCOMPANYID": strOwnerCompanyID = q.Attribute("Value").Value; break; case "CONTRACTCODE": strContRactCode = q.Attribute("Value").Value; break; case "CONTRACTTYPEID": strContRactTypeid = q.Attribute("Value").Value; break; case "CONTRACTLEVEL": strContRactLevel = q.Attribute("Value").Value; break; case "PARTYA": strPartya = q.Attribute("Value").Value; break; case "PARTYB": strPartyb = q.Attribute("Value").Value; break; case "STARTDATE": strStartDate = q.Attribute("Value").Value; break; case "ENDDATE": strEndDate = q.Attribute("Value").Value; break; case "CONTRACTFLAG": strContRactFlag = q.Attribute("Value").Value; break; case "EXPIRATIONREMINDER": strExpirationReminder = q.Attribute("Value").Value; break; case "CONTRACTTITLE": strContRactTitle = q.Attribute("Value").Value; break; case "CONTENT": strContent = q.Attribute("Value").Value; break; case "CHECKSTATE": strCheckState = q.Attribute("Value").Value; break; case "TEL": strTEL = q.Attribute("Value").Value; break; } } SmtOADocumentAdmin doc = new SmtOADocumentAdmin(); string employeeid = strEmployeeID.Replace("{", "").Replace("}", ""); T_OA_CONTRACTAPP entity = new T_OA_CONTRACTAPP(); entity.CONTRACTAPPID = Guid.NewGuid().ToString(); entity.CREATEDATE = DateTime.Now; entity.OWNERID = strOwnerID; entity.OWNERPOSTID = strOwnerPostID; entity.OWNERDEPARTMENTID = strOwnerDepartmentID; entity.OWNERCOMPANYID = strOwnerCompanyID; entity.CREATEUSERID = strOwnerID; entity.CREATEPOSTID = strOwnerPostID; entity.CREATEDEPARTMENTID = strOwnerDepartmentID; entity.CREATECOMPANYID = strOwnerCompanyID; doc.ContractApprovalAdd(entity); return entity.CONTRACTAPPID; } catch (Exception e) { string abc = "<OA>Message=[" + e.Message + "]" + "<OA>Source=[" + e.Source + "]<OA>StackTrace=[" + e.StackTrace + "]<OA>TargetSite=[" + e.TargetSite + "]"; Tracer.Debug(abc); return abc; } }
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()); } }
private void GetContractPrint(V_ContractPrint contractPrint) { if (cprinting != null) { if (!string.IsNullOrEmpty(contractPrint.contractApp.contractApp.CONTRACTTITLE)) { ContractTitle.Text = contractPrint.contractApp.contractApp.CONTRACTTITLE;//标题 } cprinting = contractPrint.contractPrint; ctapp = contractPrint.contractApp.contractApp; ContractID.SelectedText = contractPrint.contractApp.contractApp.CONTRACTCODE;//合同编号 ContractTitle.Text = contractPrint.contractApp.contractApp.CONTRACTTITLE;//标题 } }
void cmsfc_GetContractViewByIdCompleted(object sender, GetContractViewByIdCompletedEventArgs e)//根据查看ID查询 { try { if (e.Error == null) { if (e.Result != null) { ContractViewObj = e.Result;//合同查看申请视图 if (actions == FormTypes.Resubmit)//重新提交 { ContractViewObj.CHECKSTATE = (Convert.ToInt32(CheckStates.UnSubmit)).ToString(); } cprinting = ContractViewObj.T_OA_CONTRACTPRINT;//打印视图 ctapp = ContractViewObj.T_OA_CONTRACTPRINT.T_OA_CONTRACTAPP; ContractID.SelectedText = ctapp.CONTRACTCODE;//合同编号 ContractTitle.Text = ctapp.CONTRACTTITLE;//标题 this.txtCompanyId.Text = Utility.GetCompanyName(ContractViewObj.OWNERCOMPANYID);//所属公司ID this.txtDepartmentId.Text = Utility.GetDepartmentName(ContractViewObj.OWNERDEPARTMENTID);//所属部门ID txtTELL.Text = ContractViewObj.TEL; txtCreateUser.Text = ContractViewObj.OWNERNAME; //if (actions == FormTypes.Audit) //{ // audit.XmlObject = DataObjectToXml<T_OA_CONTRACTVIEW>.ObjListToXml(ContractViewObj, "OA"); //} //InitAudit();//审批 RefreshUI(RefreshedTypes.AuditInfo); RefreshUI(RefreshedTypes.All); //ctrFile.Load_fileData(cprinting.CONTRACTPRINTID); } } else { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message); } } catch (Exception ex) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.ToString()); } }
[OperationContract]//添加合同申请信息 public string ContractApprovalAdd(T_OA_CONTRACTAPP ContractApproval) { using (ContractApprovalBLL cab = new ContractApprovalBLL()) { string returnStr = ""; if (!cab.IsExistContractApproval(ContractApproval.CONTRACTCODE, ContractApproval.CONTRACTTITLE, ContractApproval.CONTRACTTYPEID, ContractApproval.CONTRACTLEVEL)) { if (!cab.ContractApprovalAdd(ContractApproval)) { returnStr = "添加数据失败"; } } else { returnStr = "合同申请信息已经存在,添加数据失败"; } return returnStr; } }
[OperationContract]//更新申请信息 public string UpdateContraApproval(T_OA_CONTRACTAPP contraApprovalInfo) { using (ContractApprovalBLL cab = new ContractApprovalBLL()) { string returnStr = ""; if (!cab.UpdateContraApproval(contraApprovalInfo)) { returnStr = "更新数据失败!"; } return returnStr; } }
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()); } }