Esempio n. 1
0
        private void Add_New_Product_Load(object sender, EventArgs e)
        {
            comboBox1.DataSource    = category.selectAll();
            comboBox1.DisplayMember = "catName";
            comboBox1.ValueMember   = "catID";

            comboBox2.DataSource    = MWhareHouse.selectAll();
            comboBox2.DisplayMember = "productName";
            comboBox2.ValueMember   = "id";
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            MWhareHouse ware = new MWhareHouse();

            ware.productName = textBox1.Text;
            ware.price       = textBox3.Text;
            ware.quantity    = Convert.ToInt32(textBox2.Text);
            ware.date        = dateTimePicker1.Text.ToString();
            ware.totalPrice  = (Convert.ToInt32(ware.price) * ware.quantity).ToString();
            MWhareHouse.addTo(ware);
        }
Esempio n. 3
0
        void fill()
        {
            BindingSource bindingSource1 = new BindingSource();

            tot = 0;
            foreach (var i in MWhareHouse.selectAll())
            {
                bindingSource1.Add(i);

                tot += Convert.ToDouble(i.totalPrice);
            }
            label7.Text = tot.ToString();
            dataGridView1.DataSource = bindingSource1;
        }
Esempio n. 4
0
 private void button2_Click(object sender, EventArgs e)
 {
     MWhareHouse.deleteWithID(Convert.ToInt32(dataGridView1.Rows[curentRow].Cells["id"].Value));
     fill();
 }