Пример #1
0
        public async Task <ActionResult> AddMyShop(AddMyShopForm addMyShopForm)
        {
            if (!ModelState.IsValid)
            {
                return(View(addMyShopForm));
            }

            var shop = addMyShopForm.ToShop();

            shop.Town     = _townService.GetById(addMyShopForm.TownId);
            shop.StatusId = StatusEnum.Pending;

            try
            {
                await _shopService.Create(shop, addMyShopForm.Email, AppSettings.Theme);

                await _notificationService.SendPendingShopEmail(shop.Name, addMyShopForm.Email, true, AppSettings.Theme);
            }
            catch (ApplicationException ex)
            {
                this.ModelState.AddModelError("", ex.Message);
                return(View(addMyShopForm));
            }

            return(RedirectToAction("Index").WithSuccess("Su solicitud ha sido enviada correctamente"));
        }
Пример #2
0
        public ActionResult AddMyShop()
        {
            AddMyShopForm form = new AddMyShopForm();

            return(View(form));
        }