Beispiel #1
0
        public ActionResult Edit(int id)
        {
            var shop     = _shopService.GetById(id);
            var shopForm = ShopForm.FromShop(shop);

            return(View(shopForm));
        }
        private void backBtn_Click(object sender, EventArgs e)
        {
            ShopForm sf = new ShopForm(currentUser);

            sf.Show();
            this.Hide();
        }
        public void backForm()
        {
            ShopForm sf = new ShopForm(currentUser);

            sf.Show();
            this.Hide();
        }
Beispiel #4
0
        private void button9_Click(object sender, EventArgs e)
        {
            try
            {
                sport.Close();

                ShopForm formDialog = new ShopForm();
                formDialog.ShowDialog();
                sport.Open();
            }
            catch (Exception ex)
            {
                List <Label> Labels = new List <Label>();
                Labels.Add(MyLabel.SetOKLabel("General Error"));
                Labels.Add(MyLabel.SetOKLabel(ex.Message));

                List <Button> Buttons = new List <Button>();
                Buttons.Add(MyButton.SetOKThemeButton());
                MyMessageBox.Show(
                    Labels,
                    "",
                    Buttons,
                    MyImage.SetFailed());
            }
        }
        private void магазинToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            ShopForm shopForm = new ShopForm();

            shopForm.Show();
        }
Beispiel #6
0
        public ActionResult Detail(int id)
        {
            var shop     = _shopService.GetById(id);
            var shopForm = ShopForm.FromShop(shop);

            ViewBag.ShowApprovalButtons = User.IsInRole(RolesNames.Admin) && shop.StatusId == StatusEnum.Pending;
            return(View(shopForm));
        }
Beispiel #7
0
        public ActionResult Edit(int id, ShopForm shopForm)
        {
            if (!ModelState.IsValid)
            {
                return(View(shopForm));
            }

            _shopService.Edit(shopForm.ToShop(), shopForm.Email);

            return(RedirectToAction("Index", new ShopListFiltersModel().GetRouteValues()).WithSuccess("Comercio Editado"));
        }
Beispiel #8
0
        public async Task <ActionResult> Create(ShopForm shopForm)
        {
            if (!ModelState.IsValid)
            {
                return(View(shopForm));
            }

            var shop = shopForm.ToShop();

            try
            {
                shop.StatusId = StatusEnum.Approved;
                await _shopService.Create(shop, shopForm.Email, AppSettings.Theme);

                await _notificationService.SendAccountConfirmationEmail(shop.UserId, AppSettings.Theme);
            }
            catch (ApplicationException ex)
            {
                this.ModelState.AddModelError("", ex.Message);
                return(View(shopForm));
            }

            return(RedirectToAction("Index", new ShopListFiltersModel().GetRouteValues()).WithSuccess("Comercio Creado"));
        }
Beispiel #9
0
        public ActionResult Create()
        {
            var shopForm = new ShopForm();

            return(View(shopForm));
        }
Beispiel #10
0
 public SearchClient(Form parent)
 {
     InitializeComponent();
     _shopForm = parent as ShopForm;
 }
Beispiel #11
0
 public Main(ShopForm shopForm, ProfileForm profileForm)
 {
     InitializeComponent();
     this.profileForm = profileForm;
     this.shopForm    = shopForm;
 }