public ActionResult DeleteConfirmed(int id) { khaShrot khashrot = db.khaShrots.Find(id); db.khaShrots.Remove(khashrot); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "sourceId,sourceName,remarks")] khaShrot khashrot) { if (ModelState.IsValid) { khaShrot objKhaShrot = new khaShrot(); objKhaShrot.sourceName = TrimText(khashrot.sourceName); objKhaShrot.remarks = TrimText(khashrot.remarks); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(khashrot)); }
// GET: /KharchaShrot/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } khaShrot khashrot = db.khaShrots.Find(id); if (khashrot == null) { return(HttpNotFound()); } return(View(khashrot)); }