private void create_order_button_Click(object sender, EventArgs e)
        {
            string id        = null;
            string qty       = null;
            string unit      = null;
            string linePrice = null;
            string Vat       = null;
            string prodID    = null;

            foreach (DataGridViewRow item in dataGridView1.Rows)
            {
                if (dataGridView1 != null)
                {
                    id        = item.Cells[0].Value.ToString();
                    qty       = item.Cells[2].Value.ToString();
                    unit      = item.Cells[3].Value.ToString();
                    linePrice = item.Cells[4].Value.ToString();
                    Vat       = item.Cells[5].Value.ToString();
                    prodID    = item.Cells[6].Value.ToString();

                    //LineItem Item = new LineItem(Convert.ToInt16(id), Convert.ToInt16(qty), Convert.ToDouble(unit), Convert.ToDouble(linePrice), Convert.ToDouble(Vat), Convert.ToInt16(prodID));

                    Production_Rules.AddLineItem(Convert.ToInt16(id), Convert.ToInt16(qty), Convert.ToDouble(unit), Convert.ToDouble(linePrice), Convert.ToDouble(Vat), Convert.ToInt16(prodID));
                    //  Production_Rules.AddWorkOrder(Convert.ToInt16(wOID), Convert.ToInt16(Customer_comboBox.SelectedIndex), Convert.ToInt16(prodID), Convert.ToInt16(qty), Convert.ToDateTime(datePicker));
                    //Production_Rules.AddCPOOrder();

                    this.dataGridView1.Rows.Remove(item);
                }
                else
                {
                    MessageBox.Show("No items in list!! Add items before creating order.");
                }
            }
        }
 private void btn_DeleteProduct_Click(object sender, EventArgs e)
 {
     if (prodId != 0)
     {
         if (MessageBox.Show("Are you sure you want to delete the product " + tb_name.Text + " ?", "Confirm Delete", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             Production_Rules.DeleteProduct(prodId);
             MessageBox.Show("The product " + tb_name.Text + " was successfully deleted!");
             this.Close();
         }
     }
 }
        private void btn_EditProduct_Click(object sender, EventArgs e)
        {
            if (validateFields())
            {
                try
                {
                    foreach (Product prod in product)
                    {
                        if (prodId == prod.ProductId)
                        {
                            Production_Rules.EditProduct(prodId, tb_name.Text, tb_instructions.Text, Convert.ToDouble(tb_price.Text), Convert.ToDouble(tb_vat.Text));

                            MessageBox.Show("The details for Product " + tb_name + " have been successfully updated!");
                            this.Close();
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }