Beispiel #1
0
 private void SellsEntry_Load(object sender, EventArgs e)
 {
     fillData.fillDataGridView(this.sellsEntryDataGridView, goodsDetailQueryString, this.columnNameToDisplay, this.columnIndexToHide);
     sellsEntryCutomerComboBox.Items.Clear();
     sellsEntryItemComboBox.Items.Clear();
     try
     {
         FillFormWithData comboboxDataReader = new FillFormWithData();
         MySqlDataReader  reader1            = comboboxDataReader.getDataInComboBox("customer_data", "CUST_ID,CUST_FNAME,CUST_LNAME,CUST_AREA,CUST_DISTRICT");
         MySqlDataReader  reader2            = comboboxDataReader.getDataInComboBox("item_details", "ITEM_NAME");
         if (!(reader1.HasRows))
         {
             sellsEntryCutomerComboBox.Items.Add("Not Present In Database");
         }
         if (!(reader2.HasRows))
         {
             sellsEntryItemComboBox.Items.Add("Not Present In Database");
         }
         while (reader1.Read())
         {
             sellsEntryCutomerComboBox.Items.Add(new ComboBoxItem(reader1.GetString("CUST_FNAME") + " " + reader1.GetString("CUST_LNAME") + " " + helper.nullToEmpty(reader1.GetString("CUST_AREA") + " " + reader1.GetString("CUST_DISTRICT")), reader1.GetString("CUST_ID")));
         }
         while (reader2.Read())
         {
             sellsEntryItemComboBox.Items.Add(reader2.GetString("ITEM_NAME"));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        private void GoodsEntry_Load(object sender, EventArgs e)
        {
            SetToolTip();
            goodsEntryTradercomboBox.Items.Clear();
            goodsEntryItemcomboBox.Items.Clear();

            try
            {
                FillFormWithData comboboxDataReader = new FillFormWithData();
                MySqlDataReader  reader1            = comboboxDataReader.getDataInComboBox("trader_info", "TRDR_ID,TRDR_FNAME,TRDR_TMARK");
                MySqlDataReader  reader2            = comboboxDataReader.getDataInComboBox("item_details", "ITEM_NAME");
                if (!(reader1.HasRows))
                {
                    goodsEntryTradercomboBox.Items.Add("Not Present In Database");
                }
                if (!(reader2.HasRows))
                {
                    goodsEntryItemcomboBox.Items.Add("Not Present In Database");
                }
                while (reader1.Read())
                {
                    goodsEntryTradercomboBox.Items.Add(new ComboBoxItem(reader1.GetString("TRDR_FNAME") + helper.nullToEmpty(reader1.GetString("TRDR_TMARK")), reader1.GetString("TRDR_ID")));
                }
                while (reader2.Read())
                {
                    goodsEntryItemcomboBox.Items.Add(reader2.GetString("ITEM_NAME"));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private void AddArea_Load(object sender, EventArgs e)
 {
     try
     {
         FillFormWithData comboboxDataReader = new FillFormWithData();
         MySqlDataReader  reader             = comboboxDataReader.getDataInComboBox("state", "STATE_NAME");
         while (reader.Read())
         {
             addAreaStatecomboBox.Items.Add(reader.GetString("STATE_NAME"));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #4
0
 private void custStateComboBox_DropDown(object sender, EventArgs e)
 {
     errorProvider1.Clear();
     custStateComboBox.Items.Clear();
     try
     {
         FillFormWithData comboboxDataReader = new FillFormWithData();
         MySqlDataReader  reader             = comboboxDataReader.getDataInComboBox("state", "STATE_NAME");
         while (reader.Read())
         {
             custStateComboBox.Items.Add(reader.GetString("STATE_NAME"));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #5
0
 private void custDistrictComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     errorProvider1.Clear();
     distSelected = custDistrictComboBox.SelectedItem.ToString();
     custAreaComboBox.Items.Clear();
     try
     {
         FillFormWithData comboboxDataReader = new FillFormWithData();
         MySqlDataReader  reader             = comboboxDataReader.getDataInComboBox("area", "AREA_NAME", "STATE_NAME", stateSelected, "DISTRICT_NAME", distSelected);
         while (reader.Read())
         {
             custAreaComboBox.Items.Add(reader.GetString("AREA_NAME"));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void AddTraderFrm_Load(object sender, EventArgs e)
 {
     try
     {
         FillFormWithData comboboxDataReader = new FillFormWithData();
         MySqlDataReader  reader             = comboboxDataReader.getDataInComboBox("state", "STATE_NAME");
         if (!(reader.HasRows))
         {
             traderStateComboBox.Items.Add("Not Found In Databases");
         }
         while (reader.Read())
         {
             traderStateComboBox.Items.Add(reader.GetString("STATE_NAME"));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #7
0
 private void AddItem_Load(object sender, EventArgs e)
 {
     try
     {
         FillFormWithData comboboxDataReader = new FillFormWithData();
         MySqlDataReader  reader             = comboboxDataReader.getDataInComboBox("product_category", "PRODUCT_CATEGORY_NAME");
         if (!(reader.HasRows))
         {
             addItemCategorycomboBox.Items.Add("Not Found In Databases");
         }
         while (reader.Read())
         {
             addItemCategorycomboBox.Items.Add(reader.GetString("PRODUCT_CATEGORY_NAME"));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void traderStateComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     errorProvider1.Clear();
     stateSelected = traderStateComboBox.SelectedItem.ToString();
     traderDistComboBox.Items.Clear();
     try
     {
         FillFormWithData comboboxDataReader = new FillFormWithData();
         MySqlDataReader  reader             = comboboxDataReader.getDataInComboBox("district", "DISTRICT_NAME", "STATE_NAME", stateSelected);
         if (!(reader.HasRows))
         {
             traderDistComboBox.Items.Add("Not Found In Databases");
         }
         while (reader.Read())
         {
             traderDistComboBox.Items.Add(reader.GetString("DISTRICT_NAME"));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }