Exemplo n.º 1
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            GetAllData();

            //MessageBox.Show($"{_salesModel.Category}{Environment.NewLine}{_salesModel.Product}");

            string message = _salesManager.CanBeAdded(_salesModel);

            if (message.Equals("True"))
            {
                if (_salesManager.IsReorderLevelReached(_salesModel))
                {
                    MessageBox.Show("Reorder Level Reached!");
                }

                _salesManager.AddToCart(GetProductDetails());


                //_salesManager.AddToSales(_salesModel);
                //MessageBox.Show(_salesManager.productDetailsList.Count.ToString());


                salesDataGridView.DataSource = null;
                salesDataGridView.DataSource = _salesManager.productDetailsList;

                FillTotalAndAll();

                ClearUI("product");
            }
            else
            {
                MessageBox.Show(message);
            }
        }