public ActionResult Create([Bind(Include = "InvoiceReminderTypeId,ReminderSubject,ReminderBody")] InvoiceReminderType invoiceReminderType) { if (ModelState.IsValid) { db.InvoiceReminderTypes.Add(invoiceReminderType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(invoiceReminderType)); }
// GET: InvoiceReminderTypes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } InvoiceReminderType invoiceReminderType = db.InvoiceReminderTypes.Find(id); if (invoiceReminderType == null) { return(HttpNotFound()); } return(View(invoiceReminderType)); }
public ActionResult DeleteConfirmed(int id) { try { InvoiceReminderType invoiceReminderType = db.InvoiceReminderTypes.Find(id); db.InvoiceReminderTypes.Remove(invoiceReminderType); db.SaveChanges(); return(RedirectToAction("Index")); } catch (ArgumentNullException) { ViewBag.Message = "Sorry, couldn't delete due to a concurrency issue <br />This may have already been deleted"; return(RedirectToAction("Index")); } }
public ActionResult Edit([Bind(Include = "InvoiceReminderTypeId,ReminderSubject,ReminderBody, RowVersion")] InvoiceReminderType invoiceReminderType) { if (!ModelState.IsValid) { return(View(invoiceReminderType)); } try { db.Entry(invoiceReminderType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } catch (DbUpdateConcurrencyException) { ViewBag.Message = "Sorry, couldn't update due to a concurrency issue <br />Please try again"; return(View(invoiceReminderType)); } }