public ActionResult Create(MoneyCreateViewModel viewModel) { if (ModelState.IsValid == false) { return(View("Index", viewModel)); } this._accountService.CreateMoneyBilling(viewModel); this.ClearCache(); return(RedirectToAction("Index")); }
public void Create(MoneyCreateViewModel MoneyCreateViewModel) { var ActBook = new AccountBook { Id = MoneyCreateViewModel.Id, Categoryyy = MoneyCreateViewModel.Category, Amounttt = MoneyCreateViewModel.Amount, Dateee = MoneyCreateViewModel.Date, Remarkkk = MoneyCreateViewModel.Remark }; _accountBookRep.Create(ActBook); }
/// <summary> /// Creates the money billing. /// </summary> /// <param name="viewModel">The view model.</param> /// <exception cref="NotImplementedException"></exception> public void CreateMoneyBilling(MoneyCreateViewModel viewModel) { if (viewModel == null) { throw new ArgumentNullException(nameof(viewModel)); } var item = new AccountBook { Amounttt = Convert.ToInt32(viewModel.Amount), Categoryyy = (int)viewModel.Category, Dateee = viewModel.CreateTime, Remarkkk = viewModel.Remark }; this._accountBookRepository.Insert(item); }
public ActionResult Create(MoneyCreateViewModel NewMoney) { if (ModelState.IsValid) { NewMoney.Id = Guid.NewGuid(); _moneyService.Create(NewMoney); _moneyService.Save(); } ViewBag.Category = _moneyService.GetCategoryItems(); ShowMoneyListViewModel MoneyList = new ShowMoneyListViewModel(); MoneyList.MyMoney = _moneyService.DisplayPagedData(1, pageSize); ViewData["MoneyData"] = MoneyList; return(View()); }