public void Add(PersonalAccountingViewModel order) { _accountBookRepository.Create(new AccountBook() { Id = Guid.NewGuid(), Amounttt = (int)order.Amount, Categoryyy = (int)order.Category, Dateee = order.Date, Remarkkk = order.Remark }); }
public void Edit(Guid id, PersonalAccountingViewModel pageData) { var oldData = _accountBookRepository.GetSingle(d => d.Id == id); if (oldData != null) { oldData.Amounttt = (int)pageData.Amount; oldData.Categoryyy = (int)pageData.Category; oldData.Dateee = pageData.Date; oldData.Remarkkk = pageData.Remark; } }
public ActionResult Input([Bind(Include = "Category,Date,Amount,Remark")] PersonalAccountingViewModel accountingViewModel) { if (ModelState.IsValid) { _accountBookService.Add(accountingViewModel); _unitOfWork.Commit(); ModelState.Remove("Category"); ModelState.Remove("Date"); ModelState.Remove("Amount"); ModelState.Remove("Remark"); } return(View()); }