Example #1
0
        public ActionResult Create(MoneyCreateViewModel viewModel)
        {
            if (ModelState.IsValid == false)
            {
                return(View("Index", viewModel));
            }
            this._accountService.CreateMoneyBilling(viewModel);

            this.ClearCache();
            return(RedirectToAction("Index"));
        }
Example #2
0
        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);
        }
Example #3
0
        /// <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);
        }
Example #4
0
        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());
        }