Пример #1
0
        public ActionResult Create(AccountViewModel vm)
        {
            if (!ModelState.IsValid)
            {
                return(View(vm));
            }

            CommandStackWorkerService.AddAccount(vm);
            return(RedirectToAction("Details", new { id = vm.CustomerId }));
        }
Пример #2
0
        public ActionResult Add(CustomerViewModel vm)
        {
            if (!ModelState.IsValid)
            {
                return(View(vm));
            }

            CommandStackWorkerService.AddCustomer(vm);
            return(RedirectToAction("Index"));
        }
Пример #3
0
        public ActionResult TransferMoney(TransferViewModel vm)
        {
            if (!ModelState.IsValid)
            {
                return(View(vm));
            }

            if (vm.Amount == 0)
            {
                return(RedirectToAction("Index"));
            }

            CommandStackWorkerService.TransferMoney(vm);
            return(RedirectToAction("Details", new { id = vm.CustomerId }));
        }
Пример #4
0
        public ActionResult EditAddress(AddressViewModel vm)
        {
            if (!ModelState.IsValid)
            {
                return(View(vm));
            }

            if (!this.ÎsAddressDirty(vm))
            {
                return(RedirectToAction("Details", new { id = vm.AggregateId }));
            }

            CommandStackWorkerService.EditAddressDetails(vm);
            return(RedirectToAction("Details", new { id = vm.AggregateId }));
        }
Пример #5
0
        public ActionResult EditCustomer(PersonViewModel vm)
        {
            if (!ModelState.IsValid)
            {
                return(View(vm));
            }

            if (!this.IsPersonDirty(vm))
            {
                return(RedirectToAction("Details", new { id = vm.AggregateId }));
            }

            CommandStackWorkerService.EditPersonDetails(vm);
            return(RedirectToAction("Details", new { id = vm.AggregateId }));
        }
Пример #6
0
 public ActionResult UnlockAccount(Guid accountId, Guid customerId)
 {
     CommandStackWorkerService.UnlockAccount(accountId);
     return(RedirectToAction("Details", new { id = customerId }));
 }
Пример #7
0
 public ActionResult DeleteCustomer(Guid id)
 {
     CommandStackWorkerService.DeleteCustomer(id);
     return(RedirectToAction("Details", new { id = id }));
 }