Пример #1
0
        public void ConfirmDisbursementSendEmail(string fromEmail, string password, string username, List <Disbursement> dList, DateTime disburseDate)
        {
            foreach (Disbursement d in dList)
            {
                try
                {
                    string deptCode = d.DepartmentCode;
                    string toEmail  = GetDepartmentRepEmail(deptCode);
                    if (toEmail != null)
                    {
                        string        emailSubject = "Confirmed Disbursement Date " + disburseDate.ToString("d MMM yyyy");
                        StringBuilder emailBody    = new StringBuilder();
                        emailBody.AppendLine("The following disbursement date has been confirmed at " + disburseDate.ToString("d MMM yyyy") + ":");
                        emailBody.AppendLine("http://localhost/Store/ViewDisbursementDetails?DISBURSEMENTCODE=" + d.DisbursementCode);

                        emailBody.AppendLine("The disbursement has been confirmed by " + employeeDAO.GetEmployeeName(username));
                        emailBody.AppendLine();
                        emailBody.AppendLine("This email is automatically generated");

                        SendEmail(fromEmail, password, toEmail, emailSubject, emailBody.ToString());
                    }
                }
                catch (SmtpFailedRecipientsException ex)
                {
                    throw ex;
                }
                catch (SmtpException ex)
                {
                    throw ex;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
Пример #2
0
 public string GetEmployeeNameByUsername(string username)
 {
     return(employeeDAO.GetEmployeeName(username));
 }
Пример #3
0
 public string GetEmployeeNameByUserName(string userName)
 {
     return(Iempl.GetEmployeeName(userName));
 }
 public string GetEmployeeName(string userName)
 {
     return(empDao.GetEmployeeName(userName));
 }