Esempio n. 1
0
        private void categoryComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            categoryComboboxerrorLabel.Text = "";
            int categoryId = Convert.ToInt32(categoryComboBox.SelectedValue);


            if (categoryId > 0)
            {
                stockDataGridView.DataSource = null;
                List <Stock> stocks = new List <Stock>();

                stocks = _sharedManager.SearchStockReportByDate(startDateTimePicker.Text, endDateTimePicker.Text, categoryId, 0);

                if (stocks.Count != 0)
                {
                    stockDataGridView.DataSource = stocks;
                }
                else
                {
                    stockDataGridView.DataSource = null;
                    MessageBox.Show(@"No Result Found", @"Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }



            productComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
            productComboBox.DataSource    = _productManager.GetAllProductForComboBox(categoryId);
        }