public ActionResult DeleteConfirmed(int id) { Models.SendEmail sendEmail = db.SendEmail.Find(id); db.SendEmail.Remove(sendEmail); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,From,To,Text")] Models.SendEmail sendEmail) { if (ModelState.IsValid) { db.Entry(sendEmail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sendEmail)); }
public ActionResult Create([Bind(Include = "Id,From,To,Text")] Models.SendEmail sendEmail) { Index(sendEmail); if (ModelState.IsValid) { db.SendEmail.Add(sendEmail); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sendEmail)); }
// GET: SendEmails/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Models.SendEmail sendEmail = db.SendEmail.Find(id); if (sendEmail == null) { return(HttpNotFound()); } return(View(sendEmail)); }