public ActionResult DeleteConfirmed(int id) { paytype paytype = db.paytypes.Find(id); db.paytypes.Remove(paytype); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "paytype_id,paytype_name")] paytype paytype) { if (ModelState.IsValid) { db.Entry(paytype).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(paytype)); }
public List <paytype> Acclist() { List <paytype> mlist = new List <paytype>(); paytype p1 = new paytype("1", "Cash"); paytype p2 = new paytype("2", "Cheque"); paytype p3 = new paytype("3", "Net Banking"); mlist.Add(p1); mlist.Add(p2); mlist.Add(p3); return(mlist); }
public ActionResult Create([Bind(Include = "paytype_id,paytype_name")] paytype paytype) { if (ModelState.IsValid) { db.paytypes.Add(paytype); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(paytype)); }
// GET: paytypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } paytype paytype = db.paytypes.Find(id); if (paytype == null) { return(HttpNotFound()); } return(View(paytype)); }