/// <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)); }
/// <summary> /// /// </summary> /// <param name="step"></param> /// <param name="accountID"></param> /// <returns></returns> public List <string> GetAccountMailListByDiyProcessIDAccountID(DiyStep step, int accountID) { List <string> mailToList = new List <string>(); List <Account> accounts = step.MailAccount; for (int i = 0; i < step.MailRole.Count; i++) { DiyProcess hrProcess = _DiyEmployeeProcessDal.GetDiyProcessByProcessTypeAndAccountID(step.MailRole[i], accountID); accounts.AddRange(hrProcess.DiySteps[0].MailAccount); } foreach (Account account in accounts) { Account innaccount = _IAccountBll.GetAccountById(account.Id); mailToList.AddRange(HrmisUtility.GetMail(innaccount)); } RequestUtility.CleanMailAddress(mailToList); return(mailToList); }