/// <summary>
        /// 新增查看申请
        /// </summary>
        /// <param name="ContractPrintingInfo">申请查看实体</param>
        /// <returns></returns>
        public bool ContractViewapplicationsAdd(T_OA_CONTRACTVIEW ContractApplicationView)
        {
            try
            {
                T_OA_CONTRACTPRINT Printing = (from a in dal.GetObjects <T_OA_CONTRACTPRINT>()
                                               where a.CONTRACTPRINTID == ContractApplicationView.T_OA_CONTRACTPRINT.CONTRACTPRINTID
                                               select a).FirstOrDefault();

                ContractApplicationView.T_OA_CONTRACTPRINT = Printing;
                ContractApplicationView.CREATEDATE         = Convert.ToDateTime(DateTime.Now.ToShortDateString());

                bool i = Add(ContractApplicationView);
                if (i == true)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                Tracer.Debug("合同申请ContractViewapplicationsBLL-ContractViewapplicationsAdd" + System.DateTime.Now.ToString() + " " + ex.ToString());
                throw (ex);
            }
        }
Example #2
0
        /// <summary>
        /// 上传附件
        /// </summary>
        /// <param name="contraTemplate">打印上传附件实体</param>
        /// <returns></returns>
        public bool UpdateContractPrinting(T_OA_CONTRACTPRINT contractPrinting)
        {
            bool result = false;
            try
            {
                var users = from ent in dal.GetObjects<T_OA_CONTRACTPRINT>()
                            where ent.CONTRACTPRINTID == contractPrinting.CONTRACTPRINTID
                            select ent;

                if (users.Count() > 0)
                {
                    var user = users.FirstOrDefault();
                    user.SIGNDATE = contractPrinting.SIGNDATE;//签订时间
                    user.ISUPLOAD = contractPrinting.ISUPLOAD;//是否已上传
                    user.UPDATEDATE = Convert.ToDateTime(DateTime.Now.ToShortDateString());//修改时间
                    user.UPDATEUSERID = contractPrinting.UPDATEUSERID;//修改人ID
                    user.UPDATEUSERNAME = contractPrinting.UPDATEUSERNAME;//修改人姓名

                    int i = dal.Update(user);

                    if (i == 1)
                    {
                        result = true;
                    }
                }
                return result;
            }
            catch (Exception ex)
            {
                Tracer.Debug("合同申请ContractApprovalBLL-UpdateContractPrinting" + System.DateTime.Now.ToString() + " " + ex.ToString());
                throw (ex);
            }
        }
Example #3
0
        /// <summary>
        /// 添加合同打印
        /// </summary>
        /// <param name="ContractPrintingInfo">打印实体</param>
        /// <returns></returns>
        public bool ContractPrintingAdd(T_OA_CONTRACTPRINT ContractPrintingInfo)
        {
            try
            {
                T_OA_CONTRACTAPP Printing = (from a in dal.GetObjects<T_OA_CONTRACTAPP>()
                                             where a.CONTRACTAPPID == ContractPrintingInfo.T_OA_CONTRACTAPP.CONTRACTAPPID
                                             select a).FirstOrDefault();

                ContractPrintingInfo.T_OA_CONTRACTAPP = Printing;
                ContractPrintingInfo.CREATEDATE = Convert.ToDateTime(DateTime.Now.ToShortDateString());

                int printAdd = dal.Add(ContractPrintingInfo);
                if (printAdd > 0)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch (Exception ex)
            {
                Tracer.Debug("合同打印ContractApprovalBLL-ContractPrintingAdd" + System.DateTime.Now.ToString() + " " + ex.ToString());
                throw (ex);
            }
        }
 private void InitEvent()
 {
     cmsfc        = new SmtOADocumentAdminClient();
     cprinting    = new T_OA_CONTRACTPRINT();
     personclient = new PersonnelServiceClient();
     cmsfc.ContractPrintingAddCompleted     += new EventHandler <ContractPrintingAddCompletedEventArgs>(cmsfc_ContractPrintingAddCompleted);       //打印
     cmsfc.UpdateContractPrintingCompleted  += new EventHandler <UpdateContractPrintingCompletedEventArgs>(cmsfc_UpdateContractPrintingCompleted); //上传附件
     personclient.GetEmployeeByIDsCompleted += new EventHandler <GetEmployeeByIDsCompletedEventArgs>(personclient_GetEmployeeByIDsCompleted);
 }
 [OperationContract]//(更新合同打印)上传附件
 public string UpdateContractPrinting(T_OA_CONTRACTPRINT contractPrinting)
 {
     using (ContractApprovalBLL cab = new ContractApprovalBLL())
     {
         string result = "";
         if (!cab.UpdateContractPrinting(contractPrinting))
         {
             result = "更新或上传数据失败!";
         }
         return(result);
     }
 }
        [OperationContract]//添加合同打印
        public string ContractPrintingAdd(T_OA_CONTRACTPRINT ContractPrintingInfo)
        {
            using (ContractApprovalBLL cab = new ContractApprovalBLL())
            {
                string returnStr = "";

                if (!cab.ContractPrintingAdd(ContractPrintingInfo))
                {
                    returnStr = "添加数据失败";
                }
                return(returnStr);
            }
        }
Example #7
0
        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; //标题
            }
        }
Example #8
0
        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());
            }
        }
        private void GetSelectContractApplications(V_ContractApplications contractApp)
        {
            if (contractApp != null)
            {
                if (!string.IsNullOrEmpty(contractApp.contractApp.CONTRACTTITLE))
                {
                    ContractTitle.Text = contractApp.contractApp.CONTRACTTITLE; //标题
                }
                cprinting = contractApp.contractPrint;                          //打印
                ctapp     = contractApp.contractApp;

                ContractID.SelectedText     = contractApp.contractApp.CONTRACTCODE;                   //合同编号
                ContractLevel.SelectedIndex = Convert.ToInt32(contractApp.contractApp.CONTRACTLEVEL); //级别
                ContractTitle.Text          = contractApp.contractApp.CONTRACTTITLE;                  //标题
                StartTime.Text = contractApp.contractApp.STARTDATE.ToString();                        //开始时间
                EndTime.Text   = contractApp.contractApp.ENDDATE.ToString();                          //结束时间
                //ContractText.Text = contractApp.contractApp.CONTENT;//正文

                //ContractText.RichTextBoxContext = contractApp.contractApp.CONTENT;
                Party.Add(contractApp.contractApp.PARTYA);    //甲方
                Party.Add(contractApp.contractApp.PARTYB);    //乙方
                personclient.GetEmployeeByIDsAsync(Party);
                switch (contractApp.contractApp.CONTRACTFLAG) //申请标志
                {
                case "0":
                    this.RbtNo.IsChecked  = false;
                    this.rbtYes.IsChecked = true;
                    break;

                case "1":
                    this.RbtNo.IsChecked  = true;
                    this.rbtYes.IsChecked = false;
                    break;
                }
            }
        }
        private void Save()
        {
            try
            {
                if (Check())
                {
                    RefreshUI(RefreshedTypes.ShowProgressBar); //点击保存后显示进度条
                    string StartTime     = string.Empty;       //开始时间
                    string StrEndTime    = string.Empty;       //结束时间
                    string StrFlag       = string.Empty;
                    string StrDateSigned = string.Empty;       //签订时间

                    StartTime     = this.StartTime.Text.ToString();
                    StrEndTime    = this.EndTime.Text.ToString();
                    StrDateSigned = this.DateSigned.Text.ToString();

                    DateTime DtStart        = new DateTime();
                    DateTime DtEnd          = new DateTime();
                    DateTime DtStrDateSigne = new DateTime();//签订时间

                    if (!string.IsNullOrEmpty(StartTime) && !string.IsNullOrEmpty(StrEndTime))
                    {
                        DtStart = System.Convert.ToDateTime(StartTime);
                        DtEnd   = System.Convert.ToDateTime(StrEndTime);
                        if (DtStart >= DtEnd)
                        {
                            Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("StartDateEndDatemustbegreaterthan", ""));
                            this.StartTime.Focus();
                            RefreshUI(RefreshedTypes.HideProgressBar);//关闭进度条动画
                            return;
                        }
                    }
                    if (!string.IsNullOrEmpty(StrDateSigned))//签订时间
                    {
                        DtStrDateSigne = System.Convert.ToDateTime(StrDateSigned);
                        if (DtStrDateSigne <= DateTime.Now)
                        {
                            Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("DATECOMPARECURENTTIME", "DATESIGNED"));
                            this.StartTime.Focus();
                            RefreshUI(RefreshedTypes.HideProgressBar);//关闭进度条动画
                            return;
                        }
                    }
                    if (this.rbtYes.IsChecked == true)
                    {
                        StrFlag = "1";
                    }
                    if (this.RbtNo.IsChecked == true)
                    {
                        StrFlag = "0";
                    }
                    if (actions == Action.Print) //打印合同
                    {
                        cprinting = new T_OA_CONTRACTPRINT();
                        cprinting.CONTRACTPRINTID  = System.Guid.NewGuid().ToString();
                        cprinting.T_OA_CONTRACTAPP = ctapp;                                                   //合同申请ID
                        cprinting.NUM                = Convert.ToInt32(nudBalanceMonth.Value);                //打印份数
                        cprinting.ISUPLOAD           = "0";
                        cprinting.CREATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;              //创建人姓名
                        cprinting.OWNERID            = Common.CurrentLoginUserInfo.EmployeeID;                //所属用户ID
                        cprinting.OWNERNAME          = Common.CurrentLoginUserInfo.EmployeeName;              //所属用户名
                        cprinting.OWNERCOMPANYID     = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;    //所属公司ID
                        cprinting.OWNERDEPARTMENTID  = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; //所属部门ID
                        cprinting.OWNERPOSTID        = Common.CurrentLoginUserInfo.UserPosts[0].PostID;       //所属岗位ID
                        cprinting.CREATECOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;    //创建公司ID
                        cprinting.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; //创建部门ID
                        cprinting.CREATEPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;       //创建岗位ID
                        cprinting.CREATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;                //创建人
                        //ctrFile.FormID = cprinting.CONTRACTPRINTID;//上传附件
                        //ctrFile.Save();

                        cmsfc.ContractPrintingAddAsync(cprinting);
                    }
                    else //上传附件
                    {
                        cprinting.T_OA_CONTRACTAPP = ctapp;//合同申请ID
                        cprinting.SIGNDATE         = DtStrDateSigne;//签订时间
                        //if (cprinting.ISUPLOAD == "0")
                        //{
                        //    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("NOTSELECTACCESSORIES"));
                        //    RefreshUI(RefreshedTypes.ProgressBar);//关闭进度条动画
                        //    return;
                        //}
                        //else
                        //{
                        //    cprinting.ISUPLOAD = "1";
                        //}
                        cprinting.ISUPLOAD       = "1";
                        cprinting.UPDATEUSERID   = Common.CurrentLoginUserInfo.EmployeeID;   //修改人ID
                        cprinting.UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName; //修改人姓名
                        //ctrFile.FormID = cprinting.CONTRACTPRINTID;//上传附件
                        //ctrFile.Save();

                        cmsfc.UpdateContractPrintingAsync(cprinting);
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.SendException("保存Save函数", "OA", "T_OA_CONTRACTPRINT", "保存合同打印返回错误", ex, ExceptionLevel.Middle, ExceptionType.Error);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }
        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 UpdateContractPrinting(T_OA_CONTRACTPRINT contractPrinting)
 {
     using (ContractApprovalBLL cab = new ContractApprovalBLL())
     {
         string result = "";
         if (!cab.UpdateContractPrinting(contractPrinting))
         {
             result = "更新或上传数据失败!";
         }
         return result;
     }
 }
        [OperationContract]//添加合同打印
        public string ContractPrintingAdd(T_OA_CONTRACTPRINT ContractPrintingInfo)
        {
            using (ContractApprovalBLL cab = new ContractApprovalBLL())
            {
                string returnStr = "";

                if (!cab.ContractPrintingAdd(ContractPrintingInfo))
                {
                    returnStr = "添加数据失败";
                }
                return returnStr;
            }
        }