public ActionResult DeleteConfirmed(int id) { CustomerSM customerSM = db.CustomerSMS.Find(id); db.CustomerSMS.Remove(customerSM); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,PackageID,RemainingSMS")] CustomerSM customerSM) { if (ModelState.IsValid) { db.Entry(customerSM).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customerSM)); }
public ActionResult Create([Bind(Include = "Id,PackageID,RemainingSMS")] CustomerSM customerSM) { if (ModelState.IsValid) { db.CustomerSMS.Add(customerSM); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customerSM)); }
// GET: CustomerSMS/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CustomerSM customerSM = db.CustomerSMS.Find(id); if (customerSM == null) { return(HttpNotFound()); } return(View(customerSM)); }