Beispiel #1
0
        /// <summary>
        /// Updates the money billing.
        /// </summary>
        /// <param name="editViewModel">The edit view model.</param>
        public void UpdateMoneyBilling(MoneyEditViewModel editViewModel)
        {
            var entity = new AccountBook
            {
                Id         = editViewModel.Id,
                Dateee     = editViewModel.DateTime,
                Amounttt   = Convert.ToInt32(editViewModel.Amount),
                Categoryyy = (int)editViewModel.Category,
                Remarkkk   = editViewModel.Remark
            };

            this._accountBookRepository.Update(entity);
        }
Beispiel #2
0
        /// <summary>
        /// Gets the specified identifier.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <returns></returns>
        public MoneyEditViewModel Get(Guid id)
        {
            var source = this._accountBookRepository
                         .GetAll()
                         .Single(x => x.Id == id);
            var entity = new MoneyEditViewModel
            {
                Amount   = source.Amounttt,
                Category = source.Categoryyy.ParseEnum <CategoryType>(),
                DateTime = source.Dateee,
                Id       = source.Id,
                Remark   = source.Remarkkk
            };

            return(entity);
        }
Beispiel #3
0
 public ActionResult Edit(MoneyEditViewModel viewModel)
 {
     this._accountService.UpdateMoneyBilling(viewModel);
     this.ClearCache();
     return(RedirectToAction("Index"));
 }