This tutorial will teach you how to make a MilkBar Inventory Management System using c#.net step by step. This system will helpful you to learn Inventory Management System.
Paste the Code inside the Add Button
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | double sum = 0; if (ChkSt.Checked) { String item = "strawberry"; double qty; double cal; double price; qty = Double.Parse(txtSt.Text); if (cbSt.SelectedItem.Equals("L")) { price = 200; cal = price * qty; } else if (cbSt.SelectedItem.Equals("ML")) { price = 200; cal = price * qty / 1000; } else { price = 50; cal = price * qty; } this.dataGridView1.Rows.Add(item, price, qty, cal); } if (ChkSt.Checked) { String item = "Chocolate"; double qty; double cal; double price; qty = Double.Parse(txtCho.Text); if (cbCho.SelectedItem.Equals("L")) { price = 100; cal = price * qty; } else if (cbCho.SelectedItem.Equals("ML")) { price = 100; cal = price * qty / 1000; } else { price = 40; cal = price * qty; } this.dataGridView1.Rows.Add(item, price, qty, cal); } if (ChkVen.Checked) { String item = "Venila"; double qty; double cal; double price; qty = Double.Parse(txtVen.Text); if (cbVen.SelectedItem.Equals("L")) { price = 150; cal = price * qty; } else if (cbVen.SelectedItem.Equals("ML")) { price = 150; cal = price * qty / 1000; } else { price = 30; cal = price * qty; } this.dataGridView1.Rows.Add(item, price, qty, cal); } for (int row = 0; row < dataGridView1.Rows.Count; row++) { sum = sum + Convert.ToInt32(dataGridView1.Rows[row].Cells[3].Value); } txtTot.Text = sum.ToString(); } } |