public ActionResult DeleteConfirmed(int id) { var item = CashDrawer.Find(id); try { using (var scope = new TransactionScope()) { item.DeleteAndFlush(); } return(PartialView("_DeleteSuccesful", item)); } catch (Exception) { return(PartialView("DeleteUnsuccessful")); } //CashDrawer CashDrawers = CashDrawer.Find(id); //CashDrawers.Delete(); //return RedirectToAction("Index"); }
public ActionResult Edit(CashDrawer item) { if (!ModelState.IsValid) { return(PartialView("_Edit", item)); } var entity = CashDrawer.Find(item.Id); entity.Code = item.Code; entity.Name = item.Name; entity.Comment = item.Comment; using (var scope = new TransactionScope()) { entity.UpdateAndFlush(); } return(PartialView("_Refresh")); }
// // GET: /CashDrawers/Delete/5 public ActionResult Delete(int id) { var item = CashDrawer.Find(id); return(PartialView("_Delete", item)); }
// // GET: /CashDrawers/Edit/5 public ActionResult Edit(int id) { var item = CashDrawer.Find(id); return(PartialView("_Edit", item)); }