public ActionResult Edit(Cash cash) { if (ModelState.IsValid) { cashRepo.Update(cash); cashRepo.Save(); return Json(new { success = true }); } return PartialView("Edit", cash); }
public JsonResult Create(Cash cash) { if (ModelState.IsValid) { cash.CreatedBy = Request.Cookies["USER"].Value; cash.CreationDate = DateTime.Now; cashRepo.Insert(cash); cashRepo.Save(); return Json(new { success = true }); } return Json(cash, JsonRequestBehavior.AllowGet); }
public void Delete(Cash entity) { context.Cashes.Remove(entity); }
public void Update(Cash entity) { context.Entry(entity).State = System.Data.Entity.EntityState.Modified; }
public void Insert(Cash entity) { context.Cashes.Add(entity); }