Exemple #1
0
        public void AddOrder()
        {
            Order ord = new Order();

            ord.Description      = textBox1.Text;
            ord.Product_id       = Int32.Parse(comboBox1.Text);
            ord.Quantity_box     = Int32.Parse(textBox2.Text);
            ord.Weight           = Int32.Parse(textBox3.Text);
            ord.PalletAllocation = int.Parse(textBox4.Text);
            ord.Customer_id      = int.Parse(comboBox2.Text);
            ord.Order_date       = this.dateTimePicker1.Value;
            ord.Collection_date  = this.dateTimePicker2.Value;
            ord.Price            = double.Parse(textBox5.Text);
            ord.Status           = textBox6.Text;
            ord.Remark           = textBox7.Text;


            InsertSQL ordHnd    = new InsertSQL();
            int       addrecord = ordHnd.addNewOrder(ord);

            MessageBox.Show(addrecord + "Your record is added");
            this.Close();
        }