コード例 #1
0
ファイル: ShopController.cs プロジェクト: windygu/PointEx
        public ActionResult Edit()
        {
            var shop         = _shopService.GetById(_currentUser.Shop.Id);
            var shopEditForm = ShopEditForm.FromShop(shop);

            return(View(shopEditForm));
        }
コード例 #2
0
ファイル: ShopPage.xaml.cs プロジェクト: Altarian0/404Project
        private void EditShopBtn(object sender, RoutedEventArgs e)
        {
            if (ShopListBox.SelectedItem == null)
            {
                MessageBox.Show("Магазин не выбран", "Внимание", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            ShopEditForm shopEditForm = new ShopEditForm((Shop)ShopListBox.SelectedItem);

            shopEditForm.ShowDialog();
            ShopListBox.ItemsSource = null;

            ShopListBox.ItemsSource = DBHelper.GetContext().Shop.ToList();
        }
コード例 #3
0
ファイル: ShopController.cs プロジェクト: windygu/PointEx
        public ActionResult Edit(ShopEditForm shopEditForm)
        {
            if (!ModelState.IsValid)
            {
                return(View(shopEditForm));
            }

            shopEditForm.Id   = _currentUser.Shop.Id;
            shopEditForm.Name = _currentUser.Shop.Name;

            _shopService.Edit(shopEditForm.ToShop());

            return(RedirectToAction("Index", "Purchase").WithSuccess("Perfíl Actualizado"));
        }