public void get_Bills_for_one_Customer(View_Bill_For_Customer vw) { string ordb = "Data source=orcl;User Id=hr; Password=hr;"; OracleConnection conn; conn = new OracleConnection(ordb); conn.Open(); DataTable table = new DataTable(); DataTable table1 = new DataTable(); DataTable table2 = new DataTable(); DataTable table3 = new DataTable(); OracleCommand c = new OracleCommand(); c.Connection = conn; c.CommandText = "select * from Bill where Customer_id=:id"; c.CommandType = CommandType.Text; c.Parameters.Add("id", vw.Select_Customer_for_view_bills.SelectedItem.ToString()); OracleDataReader dre = c.ExecuteReader(); table.Columns.Add("Bill_ID", typeof(int)); table.Columns.Add("Total_price", typeof(float)); table.Columns.Add("Bill_date", typeof(string)); table.Columns.Add("Customer_id", typeof(int)); table.Columns.Add("Delivery_boy_ID", typeof(int)); table.Columns.Add("Delivery_Charges", typeof(int)); table.Load(dre); vw.DGV_Bills_one.DataSource = table; //////////////////////////////////////////////////////////// OracleCommand cmb = new OracleCommand(); cmb.Connection = conn; cmb.CommandText = "select Customer_Name,Address,Email,Phone_no from Customer where Customer_ID =' " + vw.Select_Customer_for_view_bills.SelectedItem.ToString() + "'"; cmb.CommandType = CommandType.Text; OracleDataReader drr = cmb.ExecuteReader(); table1.Columns.Add("Customer_Name", typeof(string)); table1.Columns.Add("Address", typeof(string)); table1.Columns.Add("Email", typeof(string)); table1.Columns.Add("Phone_no", typeof(string)); table1.Load(drr); vw.Datagridviewnos_one.DataSource = table1; ///////////////////////////////////////////////////////////////// OracleCommand cmbb = new OracleCommand(); cmbb.Connection = conn; cmbb.CommandText = "select Delivery_boy_Name,Phone_no from Delivery_boy where Delivery_boy_ID IN (Select Delivery_boy_ID from Bill where Customer_ID =' " + vw.Select_Customer_for_view_bills.SelectedItem.ToString() + "'" + ")"; cmbb.CommandType = CommandType.Text; OracleDataReader ddrr = cmbb.ExecuteReader(); table2.Columns.Add("Delivery_boy_Name", typeof(string)); table2.Columns.Add("Phone_no", typeof(string)); table2.Load(ddrr); vw.dataGridViewakhr_one.DataSource = table2; //////////////////////////////////////////////////////////////////////////////// OracleCommand cqm = new OracleCommand(); cqm.Connection = conn; // edite here باليز in id 3shan ehna bnktbo b edeno k input fe gomlt el insert cqm.CommandText = "select PRODUCTS_NAME from LIST_OF_BILL_PRODUCTS where Bill_ID =119"; cqm.CommandType = CommandType.Text; OracleDataReader dwre = cqm.ExecuteReader(); table3.Columns.Add("PRODUCTS_NAME", typeof(string)); table3.Load(dwre); vw.dataGridView_akhr_ymen_Cus.DataSource = table3; dre.Close(); }
private void View_bill_for_one_customer_Click(object sender, EventArgs e) { View_Bill_For_Customer cus = new View_Bill_For_Customer(); cus.Show(); }
private void button3_Click(object sender, EventArgs e) { View_Bill_For_Customer cuscus = new View_Bill_For_Customer(); cuscus.Show(); }
private void View_bills_cus_button_Click(object sender, EventArgs e) { View_Bill_For_Customer cuss = new View_Bill_For_Customer(); cuss.Show(); }