public ActionResult Edit([Bind(Include = "Id,Category,Amount,Date,Remark")] AccountBookViewModels accountBookViewModels) { if (ModelState.IsValid) { _accountBookSvc.Edit(accountBookViewModels); _accountBookSvc.Save(); return(RedirectToAction("Index")); } return(View(accountBookViewModels)); }
public ActionResult Edit([Bind(Include = "Id,Categoryyy,Amounttt,Dateee,Remarkkk")] AccountBook accountBook) { if (ModelState.IsValid) { AccountBook oldBook = _service.GetSingleAccountBook(accountBook.Id); _service.Edit(oldBook, accountBook); _unitOfWork.Commit(); return(RedirectToAction("Index")); } return(View(accountBook)); }
public ActionResult Edit([Bind(Include = "Id,Category,Amount,Date,Remark")] Models.ViewModels.EditRecordViewModel accountBook) { var oldData = _AccountBookSvc.GetSingle(accountBook.Id); if (oldData != null && ModelState.IsValid) { var theRecord = new Models.AccountBook { Id = accountBook.Id, Category = (int)accountBook.Category, Date = accountBook.Date, Amount = accountBook.Amount, Remark = accountBook.Remark }; _AccountBookSvc.Edit(theRecord, oldData); _AccountBookSvc.Save(); return(RedirectToAction("Index")); } return(View(accountBook)); }