public void View_bills_for_specific_Date(View_Bills_by_Date bil) { 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 Bill_date=:datee"; c.CommandType = CommandType.Text; c.Parameters.Add("datee", bil.Select_Date_for_view_his_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(float)); table.Load(dre); bil.DGV_Bills_one_Date.DataSource = table; //////////////////////////////////////////////////////////// OracleCommand cmb = new OracleCommand(); cmb.Connection = conn; cmb.CommandText = "select Customer_Name,Address,Email,Phone_no from Customer where Customer_ID IN (Select Customer_ID from Bill where Bill_date = '" + bil.Select_Date_for_view_his_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); bil.Datagridviewnos_one_Date.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 Billwhere Bill_date = '" + bil.Select_Date_for_view_his_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); bil.dataGridViewakhr_one_Date.DataSource = table2; //////////////////////////////////////////////////////////////////////// OracleCommand crm = new OracleCommand(); crm.Connection = conn; // edite here باليز in id 3shan ehna bnktbo b edeno k input fe gomlt el insert crm.CommandText = "select PRODUCTS_NAME from LIST_OF_BILL_PRODUCTS where Bill_ID =119"; crm.CommandType = CommandType.Text; OracleDataReader dere = crm.ExecuteReader(); table3.Columns.Add("PRODUCTS_NAME", typeof(string)); table3.Load(dere); bil.dataGridView_akhr_ymen_bill_date.DataSource = table3; dre.Close(); }
private void View_bill_for_date_Click(object sender, EventArgs e) { View_Bills_by_Date dat = new View_Bills_by_Date(); dat.Show(); }