public InventoryForm(InventoryFormPresentationModel inventoryFormPresentationModel) { InitializeComponent(); _selectProductRowIndex = -1; _inventoryFormPresentationModel = inventoryFormPresentationModel; RefreshStockDataGridView(); _stockDataGridView.CellPainting += HandleCellPainting; _stockDataGridView.CellClick += HandleCellClickEvent; _inventoryFormPresentationModel._selectCellEvent += HandleCellClicked; _inventoryFormPresentationModel._replacementEvent += HandleCellContentClicked; _inventoryFormPresentationModel.Model._stockQuantityProductChangeEvent += RefreshStockDataGridView; _inventoryFormPresentationModel.Model._backEndChangeEvent += HandleBackEndUpdate; FormClosing += HandleInventoryFormFormClosing; }
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; }