public ActionResult DeleteConfirmed(int id) { tableQLCT tableQLCT = db.tableQLCTs.Find(id); db.tableQLCTs.Remove(tableQLCT); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,name,date1,money1,ghichu")] tableQLCT tableQLCT) { if (ModelState.IsValid) { db.Entry(tableQLCT).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tableQLCT)); }
// GET: tableQLCTs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tableQLCT tableQLCT = db.tableQLCTs.Find(id); if (tableQLCT == null) { return(HttpNotFound()); } return(View(tableQLCT)); }
public ActionResult Create([Bind(Include = "id,name,date1,money1,ghichu")] tableQLCT tableQLCT) { if (tableQLCT.money1 < 0) { return(View("Create")); } if (ModelState.IsValid) { tableQLCT.date1 = DateTime.Today; db.tableQLCTs.Add(tableQLCT); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tableQLCT)); }