Exemplo n.º 1
0
 public static void fillStockItemGridViewComboNew(DataGridViewComboBoxCell cmb, string CategoryName)
 {
     cmb.Items.Clear();
     try
     {
         StockItemDB      stockitemdb = new StockItemDB();
         List <stockitem> StockItems  = stockitemdb.getStockItems();
         //foreach (stockitem si in StockItems)
         //{
         //    //if (CategoryName.Length > 0 && CategoryName != si.Category)
         //    //{
         //    //    continue;
         //    //}
         //    if (si.status == 1)
         //    {
         //        cmb.Items.Add(si.StockItemID + "-" + si.Name);
         //    }
         //}
         foreach (stockitem si in StockItems)
         {
             if (si.status == 1)
             {
                 Structures.GridViewComboBoxItem ch =
                     new Structures.GridViewComboBoxItem(si.Name, si.StockItemID);
                 cmb.Items.Add(ch);
             }
         }
         cmb.DisplayMember = "Name";  // Name Property will show(Editing)
         cmb.ValueMember   = "Value"; // Value Property will save(Saving)
     }
     catch (Exception ex)
     {
         MessageBox.Show(System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
     }
 }
Exemplo n.º 2
0
 public static void fillStockItemGridViewCombo(DataGridViewComboBoxCell cmb, string CategoryName)
 {
     cmb.Items.Clear();
     try
     {
         StockItemDB      stockitemdb = new StockItemDB();
         List <stockitem> StockItems  = stockitemdb.getStockItems();
         foreach (stockitem si in StockItems)
         {
             //if (CategoryName.Length > 0 && CategoryName != si.Category)
             //{
             //    continue;
             //}
             if (si.status == 1)
             {
                 cmb.Items.Add(si.StockItemID + "-" + si.Name);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
     }
 }