示例#1
0
        /// <summary>
        /// 发送审核结束邮件
        /// </summary>
        public void ConfirmOverMail()
        {
            bool val = true;

            foreach (OutApplicationItem item in _OutApplication.Item)
            {
                val &= item.Status == RequestStatus.ApproveCancelFail ||
                       item.Status == RequestStatus.ApproveCancelPass ||
                       item.Status == RequestStatus.ApproveFail ||
                       item.Status == RequestStatus.ApprovePass;
            }
            if (val)
            {
                MailBody mailBody = new MailBody();
                mailBody.Subject = string.Format("审核完毕{0}的外出单", _OutApplication.Account.Name);
                StringBuilder body = new StringBuilder();
                body.AppendFormat(OutApplicationMail.BuildBody(_OutApplication));
                mailBody.Body       = body.ToString();
                mailBody.IsHtmlBody = true;
                mailBody.MailTo     = RequestUtility.GetMail(_OutApplication.Account);
                foreach (OutApplicationItem item in _OutApplication.Item)
                {
                    if (item.Status == RequestStatus.ApprovePass || item.Status == RequestStatus.ApproveCancelFail)
                    {
                        mailBody.MailCc = SendMailToMailCC();
                        break;
                    }
                }
                _MailGateWay.Send(mailBody);
            }
        }
示例#2
0
        private void SendSubmitCCMail(IEnumerable <Account> cclist)
        {
            List <string> mailToList = new List <string>();

            foreach (Account account in cclist)
            {
                Account innaccount = _AccountBll.GetAccountById(account.Id);
                mailToList.AddRange(RequestUtility.GetMail(innaccount));
            }
            foreach (
                Account account in
                _OverWorkDiyProcessUtility.GetMailCC(_OverWork.Item[0].OverWorkFlow,
                                                     _OverWork.DiyProcess))
            {
                Account innaccount = _AccountBll.GetAccountById(account.Id);
                mailToList.AddRange(RequestUtility.GetMail(innaccount));
            }

            if (mailToList.Count > 0)
            {
                MailBody mailBody = new MailBody();
                BuildSubmitMailBody(mailBody, null, false);
                mailBody.MailTo  = mailToList;
                mailBody.Subject = string.Format("³­ËÍ£º{0}Ìá½»¼Ó°àÉêÇë", _OverWork.Account.Name);
                _MailGateWay.Send(mailBody);
            }
        }
示例#3
0
        private static void SendMail(Account account, Course course)
        {
            Account  temp     = _AccountBll.GetAccountById(account.Id);
            MailBody mailBody = new MailBody();

            mailBody.MailTo  = RequestUtility.GetMail(temp);
            mailBody.Subject = string.Format("您已参加名为{0}的培训课程,请在培训结束后,填写反馈问题", course.CourseName);
            StringBuilder mailContent = new StringBuilder();

            mailContent.Append("请到时参加以下培训,并在培训结束后填写反馈,谢谢<br/>");
            mailContent.AppendFormat("培训课程:{0}", course.CourseName);
            mailContent.Append("<br/>");
            mailContent.AppendFormat("培训地点:{0}", course.TrainPlace);
            mailContent.Append("<br/>");
            mailContent.AppendFormat("培训师:{0}", course.Trainer);
            mailContent.Append("<br/>");
            mailContent.AppendFormat("协调员:{0}", course.Coordinator.Name);
            mailContent.Append("<br/>");
            mailContent.AppendFormat("计划开始时间:{0}", course.ExpectST);
            mailContent.Append("<br/>");
            mailContent.AppendFormat("计划结束时间:{0}", course.ExpectET);
            mailContent.Append("<br/>");
            mailContent.AppendFormat("计划课时:{0}", course.ExpectHour);
            mailContent.Append("<br/>");
            mailBody.Body       = mailContent.ToString();
            mailBody.IsHtmlBody = true;
            _MailGateWay.Send(mailBody);
        }
示例#4
0
        private void SendSubmitToMail()
        {
            Account  mailToAccount = GetMailToAccount();
            MailBody mailBody      = new MailBody();

            BuildSubmitMailBody(mailBody, mailToAccount, true);
            mailBody.MailTo = RequestUtility.GetMail(mailToAccount);
            _MailGateWay.Send(mailBody);
        }
        /// <summary>
        ///
        /// </summary>
        private void SendCancelToMail()
        {
            Account  mailToAccount = new MailAndPhoneUtility().GetMailToAccount(_LeaveRequest, _NextStep);
            MailBody mailBody      = new MailBody();

            BuildSubmitMailBody(mailBody, mailToAccount);
            mailBody.MailTo = RequestUtility.GetMail(mailToAccount);
            _MailGateWay.Send(mailBody);
        }
示例#6
0
        private List <string> SendMailTo()
        {
            List <string> mailToList = new List <string>();

            foreach (Account account in _Accounts)
            {
                mailToList.AddRange(RequestUtility.GetMail(account));
            }
            return(mailToList);
        }
        /// <summary>
        /// 给要抄送的人发邮件,主要是人事,所以,在整个外出单审核结束后发送
        /// </summary>
        private List <string> SendMailToMailCC()
        {
            List <string> mailToList = new List <string>();

            foreach (Account account in _CurrentStep.MailAccount)
            {
                Account innaccount = _AccountBll.GetAccountById(account.Id);
                mailToList.AddRange(RequestUtility.GetMail(innaccount));
            }
            return(mailToList);
        }
        /// <summary>
        /// 发送审核结束邮件
        /// </summary>
        public void ConfirmOverMail()
        {
            //MailBody mailBody = new MailBody();
            //mailBody.Subject = string.Format("{0}的请假单审核结束,请查看审核结果", _LeaveRequest.Account.Name);
            //StringBuilder body = new StringBuilder();
            //body.AppendFormat(LeaveRequestMail.BuildBody(_LeaveRequest, _LeaveRequestItem));
            //mailBody.Body = body.ToString();
            //mailBody.IsHtmlBody = true;
            //mailBody.MailTo = RequestUtility.GetMail(_LeaveRequest.Account);
            //List<string> mailToList = new List<string>();
            //foreach (Account account in _DiyProcessAccountlist)
            //{
            //    Account innaccount = _AccountBll.GetAccountById(account.Id);
            //    mailToList.AddRange(RequestUtility.GetMail(innaccount));
            //}
            //mailBody.MailCc = mailToList;
            //_MailGateWay.Send(mailBody);
            bool over = true;

            foreach (LeaveRequestItem item in _LeaveRequest.LeaveRequestItems)
            {
                over &= item.Status.Id == RequestStatus.ApproveCancelFail.Id ||
                        item.Status.Id == RequestStatus.ApproveCancelPass.Id ||
                        item.Status.Id == RequestStatus.ApproveFail.Id ||
                        item.Status.Id == RequestStatus.ApprovePass.Id;
            }
            if (over)
            {
                MailBody mailBody = new MailBody();
                mailBody.Subject =
                    string.Format("审核完毕{0}的请假单", _LeaveRequest.Account.Name);
                StringBuilder body = new StringBuilder();
                body.AppendFormat(LeaveRequestMail.BuildBody(_LeaveRequest));
                mailBody.Body       = body.ToString();
                mailBody.IsHtmlBody = true;
                mailBody.MailTo     = RequestUtility.GetMail(_LeaveRequest.Account);
                mailBody.MailCc     = SendMailToMailCC();
                foreach (LeaveRequestItem item in _LeaveRequest.LeaveRequestItems)
                {
                    if (item.Status.Id == RequestStatus.ApprovePass.Id ||
                        item.Status.Id == RequestStatus.ApproveCancelFail.Id)
                    {
                        mailBody.MailCc.AddRange(SendMailToHRMailCC());
                        break;
                    }
                }
                _MailGateWay.Send(mailBody);
            }
        }
示例#9
0
        private void BuildSubmitMailBody(MailBody mailBody, Account to, bool addConfirmAddress)
        {
            string        subject     = string.Format("请审批{0}的外出申请,", _OutApplication.Account.Name);
            StringBuilder mailContent = new StringBuilder();

            mailContent.Append(OutApplicationMail.BuildBody(_OutApplication));
            if (addConfirmAddress)
            {
                OutApplicationMail.BulidConfirmAddress(mailContent, to, _OutApplication.PKID);
            }
            mailBody.MailTo     = RequestUtility.GetMail(to);
            mailBody.Body       = mailContent.ToString();
            mailBody.Subject    = subject;
            mailBody.IsHtmlBody = true;
        }
示例#10
0
        private static void SendMail(Model.Reimburse reimburse)
        {
            Account  temp     = _AccountBll.GetAccountById(reimburse.ApplierID);
            MailBody mailBody = new MailBody();

            mailBody.MailTo  = RequestUtility.GetMail(temp);
            mailBody.Subject = "您的报销单已经通过审核,请去财务处领取报销费,谢谢。";
            StringBuilder emailContentBuilder = new StringBuilder();

            emailContentBuilder.Append(temp.Name + ",您好!");
            emailContentBuilder.Append("<br/>");
            emailContentBuilder.Append("您的报销类型为:");
            emailContentBuilder.Append(reimburse.ReimburseCategoriesEnum.Name);
            emailContentBuilder.Append("、");
            emailContentBuilder.Append("消费时间:");
            emailContentBuilder.Append(reimburse.ConsumeDateFrom.ToShortDateString());
            emailContentBuilder.Append("日");
            emailContentBuilder.Append(reimburse.ConsumeDateFrom.Hour.ToString());
            emailContentBuilder.Append("时");
            emailContentBuilder.Append(reimburse.ConsumeDateFrom.Minute.ToString());
            emailContentBuilder.Append("分");
            emailContentBuilder.Append("---");
            emailContentBuilder.Append(reimburse.ConsumeDateTo.ToShortDateString());
            emailContentBuilder.Append("日");
            emailContentBuilder.Append(reimburse.ConsumeDateTo.Hour.ToString());
            emailContentBuilder.Append("时");
            emailContentBuilder.Append(reimburse.ConsumeDateTo.Minute.ToString());
            emailContentBuilder.Append("分");
            emailContentBuilder.Append("、");
            emailContentBuilder.Append("总额:");
            emailContentBuilder.Append(reimburse.TotalCost);
            emailContentBuilder.Append("元");
            emailContentBuilder.Append("的报销单已经通过审核,请去财务处领取报销费,谢谢。");
            emailContentBuilder.Append(Environment.NewLine);
            mailBody.Body = emailContentBuilder.ToString();
            try
            {
                //发给员工邮件
                _MailGateWay.Send(mailBody);
            }
            catch
            {
                throw new Exception("员工领取报销提醒发送失败");
            }
        }
示例#11
0
        /// <summary>
        /// 给要抄送的人发邮件,主要是人事,所以,在整个外出单审核结束后发送
        /// </summary>
        private List <string> SendMailToMailCC()
        {
            List <string> mailToList = new List <string>();

            foreach (
                Account account in
                _OutDiyProcessUtility.GetLastMailCC(_OutApplication.DiyProcess))
            {
                Account innaccount = _AccountBll.GetAccountById(account.Id);
                mailToList.AddRange(RequestUtility.GetMail(innaccount));
            }
            //List<Account> accounts = _GetDiyProcess.GetHRPrincipalByAccountID(_OutApplication.Account.Id);
            //foreach (Account acc in accounts)
            //{
            //    mailToList.AddRange(RequestUtility.GetMail(acc));
            //}
            return(RequestUtility.CleanMailAddress(mailToList));
        }
        private void SendCancelCCMail()
        {
            List <string> mailToList = new List <string>();

            foreach (Account account in _DiyProcessAccountlist)
            {
                Account innaccount = _AccountBll.GetAccountById(account.Id);
                mailToList.AddRange(RequestUtility.GetMail(innaccount));
            }

            if (mailToList.Count > 0)
            {
                MailBody mailBody = new MailBody();
                BuildSubmitMailBody(mailBody, null);
                mailBody.MailTo  = mailToList;
                mailBody.Subject = string.Format("³­ËÍ£º{0}Ìá½»Çë¼ÙÉêÇë", _LeaveRequest.Account.Name);
                _MailGateWay.Send(mailBody);
            }
        }
        protected override void ExcuteSelf()
        {
            List <Model.Reimburse> reimburseList = _IReimburse.GetReimburseByDateTime();

            foreach (Model.Reimburse reimburse in reimburseList)
            {
                if (reimburse.ReimburseStatus != ReimburseStatusEnum.Reimbursing)
                {
                    continue;
                }
                Employee employee = _GetEmployee.GetEmployeeBasicInfoByAccountID(reimburse.ApplierID);
                if (employee == null)
                {
                    continue;
                }
                if (employee.EmployeeType == EmployeeTypeEnum.DimissionEmployee ||
                    employee.EmployeeType == EmployeeTypeEnum.BorrowedEmployee)
                {
                    continue;
                }
                Account  temp     = _AccountBll.GetAccountById(reimburse.ApplierID);
                MailBody mailBody = new MailBody();
                mailBody.MailTo  = RequestUtility.GetMail(temp);
                mailBody.Subject = "请尽快将以下提交的报销单送往财务处,谢谢。";
                StringBuilder emailContentBuilder = new StringBuilder();
                emailContentBuilder.Append(temp.Name + ",您好!");
                emailContentBuilder.Append("<br/>");
                emailContentBuilder.Append("您有一张报销单未送达财务处,请速将您的报销类型为:");
                emailContentBuilder.Append(reimburse.ReimburseCategoriesEnum.Name);
                emailContentBuilder.Append("消费时间:");
                emailContentBuilder.Append(reimburse.ConsumeDateFrom.ToShortDateString());
                emailContentBuilder.Append("日");
                emailContentBuilder.Append(reimburse.ConsumeDateFrom.Hour.ToString());
                emailContentBuilder.Append("时");
                emailContentBuilder.Append(reimburse.ConsumeDateFrom.Minute.ToString());
                emailContentBuilder.Append("分");
                emailContentBuilder.Append("---");
                emailContentBuilder.Append(reimburse.ConsumeDateTo.ToShortDateString());
                emailContentBuilder.Append("日");
                emailContentBuilder.Append(reimburse.ConsumeDateTo.Hour.ToString());
                emailContentBuilder.Append("时");
                emailContentBuilder.Append(reimburse.ConsumeDateTo.Minute.ToString());
                emailContentBuilder.Append("分");
                emailContentBuilder.Append("、");
                emailContentBuilder.Append("总额:");
                emailContentBuilder.Append(reimburse.TotalCost);
                emailContentBuilder.Append("元");
                emailContentBuilder.Append("的报销单送达财务处,谢谢。");
                emailContentBuilder.Append(Environment.NewLine);
                mailBody.Body = emailContentBuilder.ToString();
                try
                {
                    //发给员工邮件
                    _IMailGateWay.Send(mailBody);
                }
                catch
                {
                    throw new Exception("员工邮件提醒发送失败");
                }
                employee.EmployeeDetails = null;
            }
        }