示例#1
0
        public void loadProductInventory()
        {
            try
            {
                dataProductInventory.Rows.Clear();
                int i   = 0;
                int qty = 0;
                using (MySqlDataReader reader = pos.loadProductInventory())
                {
                    while (reader.Read())
                    {
                        i++;
                        qty += int.Parse(reader[8].ToString());
                        dataProductInventory.Rows.Add(i, reader[0].ToString(),
                                                      reader[1].ToString(),
                                                      reader[2].ToString(),
                                                      reader[3].ToString(),
                                                      reader[4].ToString(),
                                                      reader[5].ToString(),
                                                      reader[6].ToString(),
                                                      int.Parse(reader[7].ToString()),
                                                      reader[8].ToString());
                    }

                    txtTotalQty.Text = qty.ToString("#,##0.00");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#2
0
 public void loadProductInventory()
 {
     try
     {
         dataGridStockAdjustment.Rows.Clear();
         int i = 0;
         using (MySqlDataReader reader = pos.loadProductInventory())
         {
             while (reader.Read())
             {
                 i++;
                 dataGridStockAdjustment.Rows.Add(i, reader["products_id"].ToString(),
                                                  reader["barcode"].ToString(),
                                                  reader["brand_name"].ToString(),
                                                  reader["category_name"].ToString(),
                                                  reader["description"].ToString(),
                                                  reader["price"].ToString(),
                                                  reader["quantity"].ToString());
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }