Beispiel #1
0
 public OrderForm(OrderFormPresentationModel orderFormPresentationModel)
 {
     InitializeComponent();
     _buttonSelectedIndex        = -1;
     FormClosing                += HandleOrderFormFormClosing;
     _orderFormPresentationModel = orderFormPresentationModel;
     _orderFormPresentationModel.CurrentPageNumber = 1;
     _orderButton.Enabled = _orderFormPresentationModel.IsOrderButtonEnable;
     _productButtons      = new Button[Constant.BUTTON_COUNT];
     InitializeAllProductButton();
     InitializeTabControl();
     UpdateProductButtonInformation();
     _productTabControl.Selected                                        += UpdateSelectTabPage;
     _buttonAdd.Click                                                   += ClickButtonAdd;
     _previousButton.Click                                              += ClickPreviousButton;
     _nextButton.Click                                                  += ClickNextButton;
     _previousButton.Enabled                                             = _orderFormPresentationModel.IsHavePreviousPage;
     _nextButton.Enabled                                                 = _orderFormPresentationModel.IsHaveNextPage;
     _recordDataGridView.CellPainting                                   += HandleCellPainting;
     _recordDataGridView.CellContentClick                               += HandleCellContentClickEvent;
     _recordDataGridView.CellValueChanged                               += HandleCellValueChangedEvent;
     _orderFormPresentationModel._deleteEvent                           += HandleRemoveProduct;
     _orderFormPresentationModel._changeQuantityEvent                   += HandleCellValueChanged;
     _orderFormPresentationModel.Model._overStockLimitEvent             += HandleOverStockLimit;
     _orderFormPresentationModel.Model._stockQuantityProductChangeEvent += HandleQuantityChange;
     _orderFormPresentationModel.Model._backEndChangeEvent              += HandleBackEndChangeEvent;
     _orderFormPresentationModel.Model._backEndNewCategoryEvent         += HandleBackEndNewCategoryEvent;
     AddDataGridViewDeleteColumn();
     _orderButton.Click += HandleOrderButton;
     RefreshDataGridView();
     _buttonAdd.Enabled = false;
 }
 public MenuForm(OrderFormPresentationModel orderFormPresentationModel, InventoryFormPresentationModel inventoryFormPresentationModel, ProductManagementPresentationModel productManagementPresentationModel)
 {
     InitializeComponent();
     _orderSystemButton.Click         += ClickOrderSystemButton;
     _inventorySystemButton.Click     += ClickInventorySystemButton;
     _productManageSystemButton.Click += ClickProductManageSystemButton;
     _exitButton.Click                  += ClickExitButton;
     _orderFormPresentationModel         = orderFormPresentationModel;
     _inventoryFormPresentationModel     = inventoryFormPresentationModel;
     _productManagementPresentationModel = productManagementPresentationModel;
     _inventoryForm                      = new InventoryForm(_inventoryFormPresentationModel);
     _orderForm                          = new OrderForm(_orderFormPresentationModel);
     _productManagementForm              = new ProductManagementForm(_productManagementPresentationModel);
     _inventoryForm.FormClosing         += HandleInventoryFormFormClosing;
     _orderForm.FormClosing             += HandleOrderFormFormClosing;
     _productManagementForm.FormClosing += HandleProductManagementFormFormClosing;
 }