//send to form6 private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { xx1 = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); //create procedure clinic_select_nationality_gender_name(@x int) // as // select nationality,gender,patient_name as 'اسم المريض' from Registeration_patientRegisteration where patient_id =@x; // select CE_AName from tb_Contracting_Entities,Registeration_patientRegisteration where tb_Contracting_Entities.CE_Id=Registeration_patientRegisteration.catogrical_code and patient_id=@x; con1.OpenConection(); types = new SqlDbType[] { SqlDbType.Int }; name_input = new string[] { "@x" }; values = new string[] { xx1 }; SqlDataReader dr = con1.ShowDataInGridViewUsingStoredProcDR("clinic_select_nationality_gender_name", name_input, values, types); dr.Read(); xx6 = dr[0].ToString(); xx5 = dr[1].ToString(); xx2 = dr[2].ToString(); dr.NextResult(); dr.Read(); xx4 = dr[0].ToString(); dr.Close(); تعديل_الفئه_الماليه_للمريض_الخارجى f6 = new تعديل_الفئه_الماليه_للمريض_الخارجى(xx1, xx2, xx4, xx5, xx6); f6.Show(); this.Close(); con1.CloseConnection(); }
private void dataGridView3_CellClick(object sender, DataGridViewCellEventArgs e) { x5 = dataGridView3.Rows[e.RowIndex].Cells[0].Value.ToString(); x6 = dataGridView3.Rows[e.RowIndex].Cells[1].Value.ToString(); if (x3 == null) { x4 = x2; /* * create procedure clinic_select_sus(@x nvarchar(20)) * as * select * from sub_institution where sub_name=@x; * */ //cmd = new SqlCommand("clinic_select_sus", con); //cmd.CommandType = CommandType.StoredProcedure; //cmd.Parameters.AddWithValue("@x", x4); // dr = cmd.ExecuteReader(); //create procedure clinic_select_sus(@x nvarchar(20)) // as // select * from tb_Entities_Branches where EB_Aname=@x; con1.OpenConection(); types = new SqlDbType[] { SqlDbType.NVarChar }; name_input = new string[] { "@x" }; values = new string[] { x4 }; dr = con1.ShowDataInGridViewUsingStoredProcDR("clinic_select_sus", name_input, values, types); while (dr.Read()) { x3 = dr["sub_code"].ToString(); } } /*create procedure clinic_select_current_date * as * select GETDATE() ; * exec clinic_select_current_date; * */ //cmd.Connection = con; //con.Open(); //cmd = new SqlCommand("clinic_select_current_date", con); //cmd.CommandType = CommandType.StoredProcedure; //drr2 = cmd.ExecuteReader(); //drr2.Read(); //dt = drr2[0].ToString(); //drr2.Close(); con1.OpenConection(); drr2 = con1.DataReader("clinic_select_current_date"); drr2.Read(); dt = drr2[0].ToString(); drr2.Close(); تعديل_الفئه_الماليه_للمريض_الخارجى ff6 = new تعديل_الفئه_الماليه_للمريض_الخارجى(); ff6.Focus(); this.DialogResult = DialogResult.OK; ff6.Focus(); }