public void InformSellerOfContactRequest(SellerDetails det) { GetAdminEmailDetails(); if (AdminEmailAdd != null || AdminEmailAdd != "") { CustomerSendEmail(det); } }
public ActionResult Create(TABusinessLayer.SellerDetails collection) { if (ModelState.IsValid) { dbset.AddSellerDetailsToDB(collection); return(RedirectToAction("Index")); } return(View()); }
// // GET: /CatalogueMasterSeller/Edit/5 public ActionResult Edit(int id) { TABusinessLayer.SellerDetails ctitem = dbset.SellerDetailss.Single(emp => emp.sellerId == id); if (ctitem == null) { return(HttpNotFound()); } return(View(ctitem)); }
public ActionResult Edit(TABusinessLayer.SellerDetails collection) { if (ModelState.IsValid) { var num = collection.sellerId; dbset.SaveChangesSellerDetailsToDB(collection); return(RedirectToAction("Index")); } return(View(collection)); }
public void SaveChangesSellerDetailsToDB(SellerDetails collection) { using (SqlConnection con = new SqlConnection(connectionString)) { SqlCommand cmd = new SqlCommand("spSaveChangesSellerDetails", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter paramsellerAddress = new SqlParameter(); paramsellerAddress.ParameterName = "@sellerAddress"; paramsellerAddress.Value = collection.sellerAddress; cmd.Parameters.Add(paramsellerAddress); SqlParameter paramsellerExpiryDate = new SqlParameter(); paramsellerExpiryDate.ParameterName = "@sellerExpiryDate"; paramsellerExpiryDate.Value = collection.sellerExpiryDate; cmd.Parameters.Add(paramsellerExpiryDate); SqlParameter paramsellerName = new SqlParameter(); paramsellerName.ParameterName = "@sellerName"; paramsellerName.Value = collection.sellerName; cmd.Parameters.Add(paramsellerName); SqlParameter paramsellerPhone = new SqlParameter(); paramsellerPhone.ParameterName = "@sellerPhone"; paramsellerPhone.Value = collection.sellerPhone; cmd.Parameters.Add(paramsellerPhone); SqlParameter paramsellerEmail = new SqlParameter(); paramsellerEmail.ParameterName = "@sellerEmail"; paramsellerEmail.Value = collection.sellerEmail; cmd.Parameters.Add(paramsellerEmail); SqlParameter paramsellerId = new SqlParameter(); paramsellerId.ParameterName = "@sellerId"; paramsellerId.Value = collection.sellerId; cmd.Parameters.Add(paramsellerId); SqlParameter paramsellerWebsite = new SqlParameter(); paramsellerWebsite.ParameterName = "@sellerWebsite"; paramsellerWebsite.Value = collection.sellerWebsite; cmd.Parameters.Add(paramsellerWebsite); con.Open(); cmd.ExecuteNonQuery(); } }
public void CheckExpiredRegistration() { GetAdminEmailDetails(); // List<SellerDetails> cods = new List<SellerDetails>(); if (AdminEmailAdd != null || AdminEmailAdd != "") { using (SqlConnection con = new SqlConnection(connectionString)) { SqlCommand cmd2 = new SqlCommand("spGetAboutToExpiredClients", con); cmd2.CommandType = CommandType.StoredProcedure; con.Open(); SqlDataReader rd2 = cmd2.ExecuteReader(); if (rd2.HasRows) { while (rd2.Read()) { SellerDetails cod = new SellerDetails(); cod.sellerEmail = (string)rd2["SellerEmail"].ToString(); cod.sellerName = (string)rd2["sellerName"].ToString(); cod.daysLeftToExpire = rd2["daysLeftToExpire"].ToString(); cod.AcctBank = AcctBank; cod.AcctName = AcctName; cod.AcctNumber = AcctNumber; cod.AdminPhone = AdminPhone; cod.SubscriptionFee = SubscriptionFee; ExpiryWarningsToClient(cod); //cods.Add(cod); } } rd2.Dispose(); } //Send emails } }
public void AdvertExpiryWarningsToClient(SellerDetails model) { try { string Customertemplate = @"<html> <head> <style> table { width:100%; } table, th, td { border: 1px solid #e56e94; border-collapse: collapse; } th, td { padding: 5px; text-align: left; } table#t01 tr:nth-child(even) { background-color: #ffffff; } table#t01 tr:nth-child(odd) { background-color:#ffdfdd; } table#t01 th { background-color: #810541; color: white; } </style> </head> <body> <body > <div style='position:absolute; height:50px; font-size:15px; font face = 'cursive'; width:600px; background-color:#FBBBB9; padding:30px;'> <font color='#F6358A'; face='fantasy'>TRENDAFRIK</font><font color='#F6358A'; face='ar hermann'> AFRICAN FASHION FABRIQS!</font> </div> <br /> <div style='background-color: #ece8d4;style='color:grey; font-size:15px;' font face='Helvetica, Arial, sans-serif' width:600px; height:600px; padding:30px; margin-top:30px;'> <p>Dear @Model.sellerName,<p> <br /> <p>Please Be informed that Your Advert Slot Subscribtion expires in @Model.daysLeftToExpire day(s)</p> <br /> <p>Call our Contact Number on @Model.AdminPhone for Renewal Details OR Pay into the following Account <br/> Account Name: @Model.AcctName <br/> Account Number: @Model.AcctNumber <br/> Bank : @Model.AcctBank <br/> Subscription Fee: @Model.SubscriptionFee</p> <p><b>Please Use Your Registerd Name with us as Depositor Name. For Online Transfers use Your registered Name as Remark or Reference</b> </p> <p>Thank you for allowing us serve you...</p><br /> <a href='www.trendafrik.com'><b>TrendAfrik</b></a> </body> </html>" ; string mailBody = RazorEngine.Razor.Parse(Customertemplate, model); //send to client MailMessage mailMessage = new MailMessage(LogonEmailAdd, model.sellerEmail);//mailDefinition.CreateMailMessage(mailTo, ldReplacements, control); //(mailTo, ldReplacements,emailmessage,this ); mailMessage.From = new MailAddress(LogonEmailAdd, "TrendAfrik"); mailMessage.IsBodyHtml = true; mailMessage.Subject = "Your Advert Subscription will soon Expire..."; mailMessage.Body = mailBody; SmtpClient smtpClient = new SmtpClient("mail.trendafrik.com", 25); smtpClient.Credentials = new System.Net.NetworkCredential() { UserName = LogonEmailAdd, Password = LogonPwd }; smtpClient.EnableSsl = false; smtpClient.Send(mailMessage); //send to admin mailMessage = new MailMessage(LogonEmailAdd, AdminEmailAdd);//mailDefinition.CreateMailMessage(mailTo, ldReplacements, control); //(mailTo, ldReplacements,emailmessage,this ); mailMessage.From = new MailAddress(LogonEmailAdd, "TrendAfrik"); mailMessage.IsBodyHtml = true; mailMessage.Subject = "Customers Advert Subscription will soon Expire..."; mailMessage.Body = mailBody; smtpClient = new SmtpClient("mail.trendafrik.com", 25); smtpClient.Credentials = new System.Net.NetworkCredential() { UserName = LogonEmailAdd, Password = LogonPwd }; smtpClient.EnableSsl = false; smtpClient.Send(mailMessage); } catch (Exception ex) { ex.StackTrace.ToString(); throw; } }
public void CustomerSendEmail(SellerDetails model) { try { string Customertemplate = @"<html> <head> <style> table { width:100%; } table, th, td { border: 1px solid #e56e94; border-collapse: collapse; } th, td { padding: 5px; text-align: left; } table#t01 tr:nth-child(even) { background-color: #ffffff; } table#t01 tr:nth-child(odd) { background-color:#ffdfdd; } table#t01 th { background-color: #810541; color: white; } </style> </head> <body > <div style='position:absolute; height:50px; font-size:15px; font face = 'cursive'; width:600px; background-color:#FBBBB9; padding:30px;'> <font color='#F6358A'; face='fantasy'>TRENDAFRIK</font><font color='#F6358A'; face='ar hermann'> AFRICAN FASHION FABRIQS!</font> </div> <br /> <div style='background-color: #ece8d4;style='color:grey; font-size:15px;' font face='Helvetica, Arial, sans-serif' width:600px; height:600px; padding:30px; margin-top:30px;'> <p>Dear @Model.sellerName,<p> <br /> <p>Please Be informed that Your Contact Details have been passed onto a Viewer on the Website</p> <p> With the following details:<br /> <p>Name: @Model.sellerName <br /> Phone: @Model.sellerPhone </p> <br /> <p> Your Address was not given so Customers from ALL Locations call you First! </p> <p>Thank you for allowing us serve you...</p><br /> <a href='www.trendafrik.com'><b>TrendAfrik</b></a> </body> </html>" ; //string mailBody = RazorEngine.Razor.Parse(Customertemplate, model); string mailBody = "<html> <head> <style> table { width:100%;} table, th, td { border: 1px solid #e56e94; border-collapse: collapse;} th, td { padding: 5px; text-align: left;} table#t01 tr:nth-child(even) { background-color: #ffffff; } table#t01 tr:nth-child(odd) { background-color:#ffdfdd; } table#t01 th { background-color: #810541; color: white; } </style> </head> <body > <div style='position:absolute; height:50px; font-size:15px; font face = 'cursive'; width:600px; background-color:#FBBBB9; padding:30px;'> <font color='#F6358A'; face='fantasy'>TRENDAFRIK</font><font color='#F6358A'; face='ar hermann'> BEAUTIFULLY AFRICAN!!</font> </div> <br /> <div style='background-color: #ece8d4;style='color:grey; font-size:15px;' font face='Helvetica, Arial, sans-serif' width:600px; height:600px; padding:30px; margin-top:30px;'> <p>Dear " + model.sellerName + ",<p> <br /> <p>Please Be informed that Your Contact Details have been passed onto a Viewer on the Website</p> <p> With the following details:<br /> <p>Name: " + model.sellerName + " <br /> Phone: " + model.sellerPhone + " </p> <br /> <p> Your Address was not given so Customers from ALL Locations call you First! </p> <p>Thank you for allowing us serve you...</p><br /> <a href='www.trendafrik.com'><b>TrendAfrik</b></a> </body >"; MailMessage mailMessage = new MailMessage(LogonEmailAdd, model.sellerEmail);//mailDefinition.CreateMailMessage(mailTo, ldReplacements, control); //(mailTo, ldReplacements,emailmessage,this ); mailMessage.From = new MailAddress(LogonEmailAdd, "TrendAfrik"); mailMessage.IsBodyHtml = true; mailMessage.Subject = "Your Online Picture Has Been Viewed"; mailMessage.Body = mailBody; SmtpClient smtpClient = new SmtpClient("mail.trendafrik.com", 25); smtpClient.Credentials = new System.Net.NetworkCredential() { UserName = LogonEmailAdd, Password = LogonPwd }; smtpClient.EnableSsl = false; smtpClient.Send(mailMessage); } catch (Exception ex) { ex.StackTrace.ToString(); throw; } }