public void Add(ExpenseIncomeViewModel accountBook) { _accountBookRepository.Create(new AccountBook { Id = Guid.NewGuid(), Categoryyy = int.Parse(accountBook.ExpenseIncometype), Dateee = accountBook.CreateTime, Amounttt = (int)accountBook.Money, Remarkkk = accountBook.Remark }); }
public void Edit(Guid id, ExpenseIncomeViewModel pageData) { var oldData = _accountBookRepository.GetSingle(d => d.Id == id); if (oldData != null) { oldData.Categoryyy = int.Parse(pageData.ExpenseIncometype); oldData.Dateee = DateTime.Now; oldData.Amounttt = (int)pageData.Money; oldData.Remarkkk = pageData.Remark; } }
public ActionResult Create([Bind(Include = "Money,ExpenseIncometype,CreateTime,Remark")] ExpenseIncomeViewModel expenseIncomeViewModel) { var IsCreate = false; ViewData["TypeList"] = _classifyService.getOptionToSelectList("account_kind"); if (ModelState.IsValid) { _accountBookService.Add(expenseIncomeViewModel); _unitOfWork.Commit(); ModelState.Clear(); IsCreate = true; } ViewData["IsCreate"] = IsCreate; return(View()); }