Beispiel #1
0
 public void Delete(Model.UserDetail entity)
 {
     entity.IsActive = false;
     _userDetailDAL.Update(entity);
 }
Beispiel #2
0
 public void Add(Model.UserDetail entity)
 {
     _userDetailDAL.Add(entity);
 }
Beispiel #3
0
 public void Update(Model.UserDetail entity)
 {
     _userDetailDAL.Update(entity);
 }
Beispiel #4
0
        private static void tep_mail(string to_name, string to_email_address, string email_subject, string email_text, string from_email_name, string from_email_address, string file_location = "", string file_name = "", bool bcc
            = false)
        {
            try
            {
                //var emailHtmlBody = templateService.Parse(welcomeEmailTemplate, model, null, "WelcomeEmail");
                if (bcc == true)
                {

                   string bcc_email_address = BCC_EMAIL_ADDRESS;

                    //send mail
                }
                else
                {

                   //send mail

                }

                if (EMAIL_USE_HTML == "true")
                {

                }
                else
                {

                }
                // Send the process report.
                RazorEngine.Templating.TemplateService razor = new RazorEngine.Templating.TemplateService();
                MailMessage message = new MailMessage();
                SmtpClient server = new SmtpClient(ConfigurationManager.AppSettings["emailServer"]);

                message.From = new MailAddress("*****@*****.**");
                message.To.Add(ConfigurationManager.AppSettings["reportEmailRecipients"]);
                message.Subject = string.Format("Razor Email Test");
                message.IsBodyHtml = true;

                Model.UserDetail model = new Model.UserDetail()
                {
                    Name = "Gene Buryakovsky",
                    Address = ""
                };

                message.Body = razor.Parse(File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Template", "RenewalEmailTemplate.cshtml")), model, null, null);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                EventLog.WriteEntry(sSource, e.Message);
                //return string.Empty;
            }
        }