void UpdateLoan1(Loans1 l) { Loans1C inter = new Loans1C(); Loan1Checks(l); inter.UpdateLoan1(l); }
void CreatLoans1(Loans1 l)//create a loan { Loan1Checks(l); Loans1C inter = new Loans1C(); inter.CreateLoan1(l); ClientC client = new ClientC(); Client c = client.FindClient(l.ClientId); c.MiddleProcess = "1"; client.UpdateClient(c); //send mail to the manager #region send mail to employee //need to change string managerMail = "*****@*****.**"; var fromAddress = new MailAddress("*****@*****.**", "Cavalry Associates"); var toAddress = new MailAddress(managerMail, c.Fname + " " + c.Lname + " Ask For Loan"); const string fromPassword = "******"; string subject = c.Fname + " " + c.Lname + " Ask For Loan"; string body = "<h1> The Client: " + c.Fname + " " + c.Lname + " " + c.Mail + " Ask For A Loan</h1>" + "<img src=\"https://app.synccos.com/assets/images/cavalry-signin.png\" alt=\"Trulli\" width=\"500\" height=\"333\"></p>"; var smtp = new SmtpClient { Host = "smtp.gmail.com", Port = 587, EnableSsl = true, DeliveryMethod = SmtpDeliveryMethod.Network, UseDefaultCredentials = false, Credentials = new NetworkCredential(fromAddress.Address, fromPassword) }; using (var message = new MailMessage(fromAddress, toAddress) { Subject = subject, Body = body }) { message.IsBodyHtml = true; smtp.Send(message); } #endregion }
public Loans1 FindLoan1ByClient(string cid) { Loans1C l = new Loans1C(); return(l.FindLoan1ByClient(cid)); }