Example #1
0
        public static void SendMailToClient(ChequeTransaction cheque)
        {
            var custInfo = _manager.GetCustomerInfo(cheque.LoanId);
            var body = FormatBody(cheque, custInfo);
            var sms = FormatBodySms(cheque, custInfo.FirstName);

            SendMail(custInfo.Email, body);
            SendText(custInfo.Phone, sms);
        }
Example #2
0
        private int SaveCheque(ChequeViewModel cheque, int id)
        {
            var x = new ChequeTransaction()
            {
                ChequeNumber = cheque.ChequeNumber,
                LoanId = id,
                BankId = cheque.BankId,
                StatusId = cheque.StatusId,
                DateDue = cheque.DateDue,
                PaidCash = cheque.PaidCash,
                Amount = Convert.ToDecimal(cheque.Amount),
                PaymentTypeId = cheque.PaymentTypeId,
                DateCreated = DateTime.Now.Date
            };

            _db.ChequeTransactions.Add(x);
            _db.SaveChanges();

            return x.ChequeId;
        }
Example #3
0
 private static string FormatBodySms(ChequeTransaction cheque, string name)
 {
     return String.Format(
                     File.ReadAllText(System.Web.Hosting.HostingEnvironment.MapPath(ConfigurationManager.AppSettings["sms-reminder"]))
                     , name, String.Format(new System.Globalization.CultureInfo("yo-NG"), "{0:C}", @Math.Round((decimal)cheque.Amount, 2)), cheque.DateDue.Value.Date.ToShortDateString());
 }
Example #4
0
 public static string FormatBody(ChequeTransaction cheque)
 {
     return String.Format(
                     File.ReadAllText(System.Web.Hosting.HostingEnvironment.MapPath(ConfigurationManager.AppSettings["AdminReminder"]))
                     , DateTime.Now.ToShortDateString(), cheque.ChequeNumber, String.Format(new System.Globalization.CultureInfo("yo-NG"), "{0:C}", @Math.Round((decimal)cheque.Amount, 2)), cheque.DateDue.Value.Date.ToShortDateString());
 }
Example #5
0
 public static string FormatBody(ChequeTransaction cheque, UserProfile user)
 {
     return String.Format(
                     File.ReadAllText(System.Web.Hosting.HostingEnvironment.MapPath(ConfigurationManager.AppSettings["ClientReminder"]))
                     , user.FirstName, String.Format(new System.Globalization.CultureInfo("yo-NG"), "{0:C}", @Math.Round((decimal)cheque.Amount, 2)), cheque.DateDue.Value.Date.ToShortDateString());
 }
Example #6
0
        private static void SendMailToAdmin(ChequeTransaction cheque)
        {
            var adminMail = _manager.GetAdminEmail(cheque.LoanId);
            var body = FormatBody(cheque);

            SendMail(adminMail, body);
        }