コード例 #1
0
        private void btn_Update_Click(object sender, RoutedEventArgs e)
        {
            int oldQuantity    = int.Parse(txt_Quantity.Text);
            int importQuantity = int.Parse(txt_ImportQuantity.Text);

            if (oldQuantity + importQuantity <= 5)
            {
                MessageBox.Show("Cần nhập nhiều hơn mức tồn tối thiểu (5 sản phẩm)",
                                "Error",
                                MessageBoxButton.OK,
                                MessageBoxImage.Error);

                return;
            }

            GoodsImportEntity entity = new GoodsImportEntity()
            {
                ImportDate = DateTime.Now,
                ProductID  = int.Parse(txt_Id.Text),
                Quantity   = int.Parse(txt_ImportQuantity.Text)
            };

            GoodsImportDAO importDAO = new GoodsImportDAO();

            importDAO.insert(entity);

            products.RemoveAll(temp => temp.ProductID == int.Parse(txt_Id.Text));
            CollectionViewSource.GetDefaultView(listBox.ItemsSource).Refresh();

            MessageBox.Show("Nhập hàng thành công",
                            "Info",
                            MessageBoxButton.OK,
                            MessageBoxImage.Information);

            txt_ImportQuantity.Clear();

            listBox.SelectedIndex = 0;

            ImportHistory.RefreshImportHistory();
        }
コード例 #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.btnMinimize = ((System.Windows.Controls.Button)(target));

            #line 19 "..\..\StorageManagerDashboard.xaml"
                this.btnMinimize.Click += new System.Windows.RoutedEventHandler(this.BtnMinimize_OnClick);

            #line default
            #line hidden
                return;

            case 2:
                this.btnMaximize = ((System.Windows.Controls.Button)(target));

            #line 24 "..\..\StorageManagerDashboard.xaml"
                this.btnMaximize.Click += new System.Windows.RoutedEventHandler(this.BtnMaximize_OnClick);

            #line default
            #line hidden
                return;

            case 3:
                this.btnClose = ((System.Windows.Controls.Button)(target));

            #line 29 "..\..\StorageManagerDashboard.xaml"
                this.btnClose.Click += new System.Windows.RoutedEventHandler(this.BtnClose_OnClick);

            #line default
            #line hidden
                return;

            case 4:
                this.importProduct = ((StoreManagement.UserControls.Import_Product)(target));
                return;

            case 5:
                this.importHistory = ((StoreManagement.UserControls.ImportHistory)(target));
                return;

            case 6:
                this.editInformation = ((StoreManagement.UserControls.Edit_Information)(target));
                return;

            case 7:
                this.lblName = ((System.Windows.Controls.Label)(target));
                return;

            case 8:
                this.TrainsitionigContentSlide = ((MaterialDesignThemes.Wpf.Transitions.TransitioningContent)(target));
                return;

            case 9:
                this.GridCursor = ((System.Windows.Controls.Grid)(target));
                return;

            case 10:
                this.ListViewMenu = ((System.Windows.Controls.ListView)(target));

            #line 54 "..\..\StorageManagerDashboard.xaml"
                this.ListViewMenu.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.ListViewMenu_SelectionChanged);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }