public ActionResult DeleteConfirmed(int id) { custome custome = db.customes.Find(id); db.customes.Remove(custome); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,name,date,province,phone,email")] custome custome) { if (ModelState.IsValid) { db.Entry(custome).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(custome)); }
public ActionResult Create([Bind(Include = "id,name,date,province,phone,email")] custome custome) { if (ModelState.IsValid) { db.customes.Add(custome); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(custome)); }
// GET: admin/customes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } custome custome = db.customes.Find(id); if (custome == null) { return(HttpNotFound()); } return(View(custome)); }