This tutorial will teach you to make a small shop Grocery Shop Inventory system. The following system will use to manage the Grocery Shop.
paste the code inside the ok 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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | double sum = 0.0; double price; double qty; double cal = 0.0; if (chk1.Checked) { String suger = chk1.Text; String mes = txtsstatus.SelectedItem.ToString(); price = 140.0; qty = int.Parse(txtsqty.Text); if (mes.Equals("KG")) { cal = (qty * price); this.dataGridView1.Rows.Add(suger, price, qty, cal); } else { cal = (qty / 1000 * price); this.dataGridView1.Rows.Add(suger, price, qty, cal); } } if (chk2.Checked) { String tea = chk2.Text; String mes1 = txttstatus.SelectedItem.ToString(); price = 150.0; qty = int.Parse(txttqty.Text); if (mes1.Equals("KG")) { cal = (qty * price); this.dataGridView1.Rows.Add(tea, price, qty, cal); } else { cal = (qty / 1000 * price); this.dataGridView1.Rows.Add(tea, price, qty, cal); } } if (chk3.Checked) { String flour = chk3.Text; String mes2 = txtfstatus.SelectedItem.ToString(); price = 260.0; qty = int.Parse(txtfqty.Text); if (mes2.Equals("KG")) { cal = (qty * price); this.dataGridView1.Rows.Add(flour, price, qty, cal); } else { cal = (qty / 1000 * price); this.dataGridView1.Rows.Add(flour, price, qty, cal); } } if (chk4.Checked) { String rice = chk4.Text; String mes3 = txtrstatus.SelectedItem.ToString(); price = 250.0; qty = int.Parse(txtrqty.Text); if (mes3.Equals("KG")) { cal = (qty * price); this.dataGridView1.Rows.Add(rice, price, qty, cal); } else { cal = (qty / 1000 * price); this.dataGridView1.Rows.Add(rice, price, qty, cal); } } if (chk5.Checked) { String dhall = chk5.Text; String mes4 = txtdstatus.SelectedItem.ToString(); price = 300.0; qty = int.Parse(txtdqty.Text); if (mes4.Equals("KG")) { cal = (qty * price); this.dataGridView1.Rows.Add(dhall, price, qty, cal); } else { cal = (qty / 1000 * price); this.dataGridView1.Rows.Add(dhall, price, qty, cal); } } for(int row=0; row< dataGridView1.Rows.Count; row++) { sum = sum + Convert.ToInt32(dataGridView1.Rows[row].Cells[3].Value); } txtbill.Text = sum.ToString(); |
i have attached the video link below. which will do this tutorials step by step.