private void button4_Click(object sender, EventArgs e) { try { //اضافة معلومات الفتورة order.ADD_ORDERS(Convert.ToInt32(text_order_id.Text), dt_order.Value, text_order_des.Text, Convert.ToInt32(text_cust_id.Text), text_sales_man.Text); //اضافة المنتوجات المدخلة for (int i = 0; i < DGV_PRD_BILL.Rows.Count - 1; i++) { order.ADD_ORDERS_DETAILS(DGV_PRD_BILL.Rows[i].Cells[0].Value.ToString(), Convert.ToInt32(text_order_id.Text) , DGV_PRD_BILL.Rows[i].Cells[1].Value.ToString(), DGV_PRD_BILL.Rows[i].Cells[2].Value.ToString() , Convert.ToInt32(DGV_PRD_BILL.CurrentRow.Cells[3].Value), Convert.ToInt32(DGV_PRD_BILL.Rows[i].Cells[5].Value) , DGV_PRD_BILL.Rows[i].Cells[4].Value.ToString(), DGV_PRD_BILL.Rows[i].Cells[6].Value.ToString()); } MessageBox.Show("Saved Successfully", "Save Operation", MessageBoxButtons.OK, MessageBoxIcon.Information); if (MessageBox.Show("Do you want to Print this Order?", "Inquiry Process", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { button_print.Enabled = true; butto_add.Enabled = false; //MessageBox.Show("Successfully Print", "Inquiry Process", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Print Canceled", "Print Process", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); button_new.Enabled = true; } // ClearData(); } catch { return; } }