public async Task <ActionResult> Index(Models.HomePage model) { var cardTypes = GetCardTypes(); model.CardTypes = cardTypes; if (ModelState.IsValid) { var result = await SubmitCard(model.CardType.Value); model.Message = result.Message; model.MessageClass = (result.Status == System.Net.HttpStatusCode.OK) ? "text-success" : "text-danger"; } else { string validationErrors = string.Join(",", ModelState.Values.Where(E => E.Errors.Count > 0) .SelectMany(E => E.Errors) .Select(E => E.ErrorMessage) .ToArray()); model.Message = validationErrors; model.MessageClass = "text-danger"; } return(View(model)); }
public ActionResult Archive() { var hp = new Models.HomePage(); hp.ListEx = sql.CatchMe_Exception.Where(x => x.CodeStatus < 90).OrderByDescending(x => x.Date); return(View(hp)); }
// GET : CatchMe/ public ActionResult Index() { var hp = new Models.HomePage(); hp.ListEx = sql.CatchMe_Exception.Where(x => x.Masquer == false).OrderByDescending(x => x.Date); return(View(hp)); }
public async Task <ActionResult> Index() { var cardTypes = GetCardTypes(); var model = new Models.HomePage { CardTypes = cardTypes }; return(View(model)); }
public JsonResult Mailer(string id) { try { cmd = new SqlCommand("spSubsrciber", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@EmailId", id); cmd.Parameters.AddWithValue("@Qtype", "Save"); con.Open(); result = cmd.ExecuteNonQuery(); con.Close(); FourQuarterMVC.Models.HomePage obj = new Models.HomePage().GetMasterData(); SmtpClient smtp = new SmtpClient("smtp.gmail.com"); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.EnableSsl = true; smtp.Timeout = 100000; smtp.DeliveryMethod = SmtpDeliveryMethod.Network; smtp.UseDefaultCredentials = false; smtp.Credentials = new NetworkCredential(obj.MailFrom, "07320734799"); MailMessage Loginfo = new MailMessage(); Loginfo.To.Add(obj.MailFrom); Loginfo.From = new MailAddress(obj.MailFrom); Loginfo.Subject = obj.MailSubject; Loginfo.Body = obj.MailBody1 + id; Loginfo.IsBodyHtml = true; Loginfo.To.Add(id); Loginfo.From = new MailAddress(obj.MailFrom); Loginfo.Subject = obj.MailSubject; Loginfo.Body = obj.MailBody2; Loginfo.IsBodyHtml = true; smtp.Send(Loginfo); return(Json("Mail is Sent")); } catch (Exception ex) { return(Json("Invalid Email Id...!")); } }