private void button1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); string date = AncExDate.Value.ToString(); if (date != "") { cmd = new SqlCommand("bloodBank_bloodPackage_select", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("exDate", date); dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); dataGridView1.DataSource = dt; dr.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void كتابة_النتايج_Load(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); //patientID = asd.txtPatientID.Text; //patientID = asd.sendPatientID2.Text; //MessageBox.Show(patientID); cmd = new SqlCommand("labAnalysis_analysis_request_select3 ", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; // cmd = new SqlCommand("select * from analysis_request where writing_state = 'No' ", connection); dr = cmd.ExecuteReader(); // cmd = new SqlCommand("select * from analysis_request where writing_state = 'No' ", connection); // dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); dataGridView1.DataSource = dt; } catch (Exception ex) { MessageBox.Show(ex.Message); MessageBox.Show("من فضلك اختر طلب"); } connection.Close(); }
private void جمع_العينات_Load_1(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); cmd = new SqlCommand("labAnalysis_analysis_request_select1", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; // cmd = new SqlCommand(" select * from analysis_request where collection_state = 'no' ", connection); dr = cmd.ExecuteReader(); //cmd = new SqlCommand(" select * from analysis_request where collection_state = 'no' ", connection); // dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); dataGridView1.DataSource = dt; } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void بيانات_التمويل_Load(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); this.cbBloodType.Text = "دم كامل"; this.cbBloodFaction.Text = "A"; this.cbRH.Text = "+"; try { connection.Open(); da = new SqlDataAdapter("select top 1*from bloodSupplier order by id desc", connection); SqlCommandBuilder cb = new SqlCommandBuilder(da); DataSet ds = new DataSet(); da.Fill(ds); BindingSource bs = new BindingSource(); bs.DataSource = ds.Tables[0]; txtID.DataBindings.Add("text", bs, "id").ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void button1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); cmd = new SqlCommand("truncate table bill", connection); cmd.ExecuteNonQuery(); // cmd = new SqlCommand("insert into bill(req_date,req_place,patient_name,patient_id,anal_name,anal_price)values(N'" + labReqDate.Text + "',N'" + labReqPlace.Text + "',N'" + labPatientName.Text + "'," + labPatientID.Text + ",N'" + labAnalName.Text + "'," + labAnalPrice.Text + ")", connection); // cmd.ExecuteNonQuery(); cmd = new SqlCommand("labAnalysis_bill_insert", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("req_date", reqDate); cmd.Parameters.AddWithValue("req_place", reqPlace); cmd.Parameters.AddWithValue("patient_name", patientName); cmd.Parameters.AddWithValue("patient_id", patientID); cmd.Parameters.AddWithValue("anal_name", analName); cmd.Parameters.AddWithValue("anal_price", analPrice); cmd.ExecuteNonQuery(); // استلام__الفاتوره f2=new استلام__الفاتوره(); // f2.Show(); طباعه_الفاتوره___التحاليل nw = new طباعه_الفاتوره___التحاليل(); nw.Show(); connection.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void toolStripLabel1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); //cmd = new SqlCommand(" update bloodPackage set quntity +=" + resQun + " , reserveQuantity=0 where id="+ID+" ", con); cmd = new SqlCommand("bloodBank_bloodPackage_update4", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@quntity", resQun); cmd.Parameters.AddWithValue("@id", ID); cmd.ExecuteNonQuery(); MessageBox.Show("تم الغاء حجز العبوة بنجاح"); } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void انواع_التحاليل_Load(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); labID.Text = patientID; labName.Text = patientName; labAge.Text = patientAge; labGender.Text = patientGender; labReqDate.Text = reqDate; labReqPlace.Text = reqPlace; cmd = new SqlCommand("labAnalysis_analysis_info_select1 ", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; dr2 = cmd.ExecuteReader(); // cmd = new SqlCommand("select * from analysis_info ", connection); // dr2 = cmd.ExecuteReader(); DataTable dt2 = new DataTable(); dt2.Load(dr2); dataGridView3.DataSource = dt2; connection.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void toolStripButton1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); // cmd = new SqlCommand("update analysis_result set receving_state = 'yes' where id=" + resultID + "", connection); // cmd.ExecuteNonQuery(); cmd = new SqlCommand("labAnalysis_analysis_result_update3", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@resultID ", resultID); cmd.ExecuteNonQuery(); النتيجة nw = new النتيجة(resultID, resultNote, patientID, patienName); nw.Show(); } catch { MessageBox.Show("من فضلك اختر الطلب"); } connection.Close(); }
private void الرصيد_الحالى_لبنك_الدم_Load(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); //cmd = new SqlCommand("select * from bloodpackage", con); cmd = new SqlCommand("bloodBank_bloodpackage_select5", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); dataGridView1.DataSource = dt; dr.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); ////this.reportViewer1.RefreshReport(); //using (currentPackageEntities nw = new currentPackageEntities()) //{ // IPagedList<bloodPackage> List = nw.bloodPackages.ToPagedList(1,40); // bloodPackageBindingSource.DataSource = List.ToList(); //} }
private void toolStripButton1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); doctorID = txtDoctorID.Text; if (doctorID == "") { MessageBox.Show("من فضلك ادخل بيانات رقم دكتور التحاليل"); } else { //cmd = new SqlCommand("update analysis_result set confirm_state = 'yes' where id = " + resultID + "", connection); //cmd.ExecuteNonQuery(); cmd = new SqlCommand("labAnalysis_analysis_result_update1", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@resultID ", resultID); //cmd = new SqlCommand("update analysis_result set confirm_state = 'yes' where id = " + resultID + "", connection); cmd.ExecuteNonQuery(); MessageBox.Show("تم تاكيد كتابة النتيجة"); } } catch { MessageBox.Show("من فضلك اختر الطلب"); } connection.Close(); }
private void تسليم_النتايج_Load(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); // cmd = new SqlCommand("select id,result_notices,chemist_id,doctor_analysis_id,patient_number,receving_state,patient_name from analysis_result,patient where patient_number = patient_ID and receving_state = 'No' ", connection); // dr = cmd.ExecuteReader(); cmd = new SqlCommand("labAnalysis_analysis_result_select10 ", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); dataGridView1.DataSource = dt; } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void button1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); if (txtResultNote.Text != "") { try { connection.Open(); //cmd = new SqlCommand("update analysis_result set result_notices =N'" + txtResultNote.Text + "' where id = " + resultID + "", connection); // cmd.ExecuteNonQuery(); cmd = new SqlCommand("labAnalysis_analysis_result_update2", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@result_notices", txtResultNote.Text); cmd.Parameters.AddWithValue("@resultID ", resultID); cmd.ExecuteNonQuery(); MessageBox.Show("تم تاكيد كتابة النتيجة"); } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); } }
private void العبوات_منتهية_الصلاحية_Load(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); connection.Open(); try { //cmd = new SqlCommand("select * from bloodpackage where exDate <'" + dtNow.Value + "'", con); cmd = new SqlCommand("bloodBank_bloodPackage_select", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("exDate", dtNow.Value); dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); dataGridView1.DataSource = dt; dr.Close(); expiredPackagePrint nw = new expiredPackagePrint(dt); nw.Show(); //this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void toolStripLabel1_Click(object sender, EventArgs e) { //MessageBox.Show(ID + exDate); Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); cmd = new SqlCommand("bloodBank_bloodPackage_update", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("exDate", newExDate.Value); cmd.Parameters.AddWithValue("id", ID); cmd.ExecuteNonQuery(); MessageBox.Show("تم تعديل تاريخ الصلاحيه بنجاح"); } catch//(Exception ex) { //MessageBox.Show(newExDate + " " + ID); MessageBox.Show("من فضلك اختر العبوة المراد تعديل تاريخ الصاحية لها"); } connection.Close(); }
private void المنصرف_من_بنك_الدم_Load(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); //cmd = new SqlCommand("select * from whichProcess where process_state='yes'", con); cmd = new SqlCommand("bloodBank_whichProcess_select ", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); dataGridView1.DataSource = dt; dr.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); //using (outPackageEntities nw = new outPackageEntities()) //{ // whichProcessBindingSource.DataSource = nw.whichProcesses.ToList(); //} }
private void toolStripButton1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); if (tbx_patient_number.Text == string.Empty) { MessageBox.Show("من فضلك ادخل الرقم القومي للبحث"); } else { //cmd = new SqlCommand("select * from analysis_result where patient_ID = " + tbx_patient_number.Text + " ", connection); // dr = cmd.ExecuteReader(); cmd = new SqlCommand("labAnalysis_analysis_result_select11", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@patient_name", tbx_patient_number.Text); dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); dataGridView1.DataSource = dt; dataGridView1.Visible = true; dr.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void المتبرعون_Load(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); connection.Open(); try { //cmd = new SqlCommand("select * from supplier where supplierType='donator'", con); cmd = new SqlCommand("bloodBank_supplier_select", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); dataGridView1.DataSource = dt; dr.Close(); supplierPrint nw = new supplierPrint(dt); nw.Show(); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void toolStripButton2_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); if (tbx_patient_number.Text == string.Empty) { MessageBox.Show(" من فضلك ادخل الرقم القومي للمريض للبحث أولا"); } else { cmd = new SqlCommand("delete from analysis_result where patient_ID ='" + tbx_patient_number.Text + "'", connection); dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); dataGridView1.DataSource = dt; dr.Close(); dataGridView1.Visible = true; MessageBox.Show("لقد تمت عمليه المسح بنجاح"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void toolStripButton1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); cmd = new SqlCommand("labAnalysis_analysis_request_insert", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@patient_number_patient", patientID); cmd.Parameters.AddWithValue("@order_number_analysis_samples", sample_id); cmd.Parameters.AddWithValue("@request_date", reqDate); cmd.Parameters.AddWithValue("@request_place", reqPlace); cmd.Parameters.AddWithValue("@payment", analPrice); // cmd = new SqlCommand("insert into analysis_request(patient_number_patient,order_number_analysis_samples,request_date,request_place,payment) values('" + patientID + "','" + sample_id + "','" + reqDate + "',N'" + reqPlace + "','" + analPrice + "')", connection); cmd.ExecuteNonQuery(); // cmd = new SqlCommand("insert into analysis_request1(patient_number_patient,order_number_analysis_samples,request_date,request_place,payment) values('" + patientID + "','" + sample_id + "','" + reqDate + "','" + reqPlace + "','" + analPrice + "')", connection); // cmd.ExecuteNonQuery(); MessageBox.Show("تم طلب تحاليل بنجاح"); الروشتة nw = new الروشتة(analID, analName, analPrice, analQuantity, analNote, patientID, patientName, patientAge, patientGender, reqDate, reqPlace); nw.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); MessageBox.Show("لقد طلبت هذا النوع من التحاليل مسبقاً"); } connection.Close(); }
private void button1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); // cmd=new SqlCommand(" update analysis_result set receiving_way=N'"+comboBox1.Text+"' ", connection); cmd = new SqlCommand("labAnalysis_analysis_result_update ", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@recievingway", comboBox1.Text); cmd.ExecuteNonQuery(); MessageBox.Show("تمت عمليه التحديث بنجاح"); } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void button1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); cmd = new SqlCommand("truncate table print_result", connection); cmd.ExecuteNonQuery(); //MessageBox.Show("deleted"); cmd = new SqlCommand("insert into print_result(patientName,patientID ,resultNote,resultID)values(N'" + patientName + "'," + patientID + ",N'" + resultNote + "'," + resultID + ")", connection); cmd.ExecuteNonQuery(); طباعه_النتيجة___التحاليل nw = new طباعه_النتيجة___التحاليل(); nw.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); // this.Close(); }
private void toolStripButton1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); //MessageBox.Show(recevState); try { connection.Open(); // cmd = new SqlCommand("update analysis_request set receving_state = 'yes' where patient_number_patient = " + patientID + "", connection); // cmd.ExecuteNonQuery(); cmd = new SqlCommand("labAnalysis_analysis_request_update2", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@patient_number_patient", patientID); cmd.ExecuteNonQuery(); MessageBox.Show("تم استلام العينة بنجاح"); //txtPatientID.Text = patientID; //MessageBox.Show(txtPatientID.Text); } catch { MessageBox.Show("من فضلك اختر طلب اولا"); } connection.Close(); }
private void اضافه_عبوات_دم_Load(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); //cmd = new SqlCommand("select * from packageSupplying where process_state='no' ", con); cmd = new SqlCommand("bloodBank_packageSupplying_select", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); dataGridView1.DataSource = dt; dr.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void toolStripButton1_Click(object sender, EventArgs e) { //foreach (DataGridViewRow item in dataGridView1.Rows) //{ // if (bool.Parse(item.Cells[0].Value.ToString())) // { // MessageBox.Show("sellected item is : " + item.Cells[0].RowIndex.ToString()); // } //} Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); //cmd = new SqlCommand("update analysis_request set collection_state = 'yes' where patient_number_patient = " + collState + "", connection); // cmd.ExecuteNonQuery(); cmd = new SqlCommand("labAnalysis_analysis_request_update1", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@patient_number_patient", collState); cmd.ExecuteNonQuery(); MessageBox.Show("تم جمع العينة بنجاح"); } catch { MessageBox.Show("من فضلك اختر الطلب"); } connection.Close(); }
private void toolStripLabel1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { //string bloodType = cbBloodType.Text = cbBloodType.SelectedItem.ToString(); ; //string bloodFaction = cbBloodFaction.Text = cbBloodFaction.SelectedItem.ToString(); //string RH = cbRH.Text = cbRH.SelectedItem.ToString(); connection.Open(); //cmd = new SqlCommand("insert into packageSupplying(supplierID,employeeID,processType,processDate,bloodType,bloodFaction,RH,quntity,exDate) values(" + txtID.Text + " ," + txtEmpID.Text + ", 'supplying','" + dateTimePicker2.Value + "', N'" + bloodType + "' , '" + bloodFaction + "' , '" + RH + "' , " + txtQuntity.Text + ",'" + dtExDate.Value + "') ", con); cmd = new SqlCommand("bloodBank_packageSupplying_insert", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("supplierID", ID); cmd.Parameters.AddWithValue("employeeID", txtEmpID.Text); cmd.Parameters.AddWithValue("processType", dtDate.Value); cmd.Parameters.AddWithValue("processDate", dtDate.Value); cmd.Parameters.AddWithValue("bloodType", bloodType); cmd.Parameters.AddWithValue("bloodFaction", bloodFaction); cmd.Parameters.AddWithValue("RH", RH); cmd.Parameters.AddWithValue("quntity", txtQuntity.Text); cmd.Parameters.AddWithValue("exDate", dtExDate.Value); cmd.ExecuteNonQuery(); MessageBox.Show("تم الاضافة بنجاح"); } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void toolStripLabel2_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); for (int i = s; i <= listBox1.Items.Count; i++) { //MessageBox.Show(s.ToString() + " " +i.ToString()); cmd = new SqlCommand("insert into analysis_info(serv_name,price,quantity,notices,sample_id) values('" + txtServName.Text + "'," + txtPrice.Text + ",'" + txtQuantity.Text + "','" + txtNotices.Text + "'," + (i + 1) + ") ", connection); i = 100; //MessageBox.Show((i+1).ToString()); } cmd.ExecuteNonQuery(); MessageBox.Show("تم اضافة تحليل فرعى بنجاح"); } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void toolStripLabel1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); //MessageBox.Show(ID); if (ID == "") { MessageBox.Show("من فضلك اختر المتبرع"); } else { بيانات_التمويل_لمتبرع_موجود nw = new بيانات_التمويل_لمتبرع_موجود(ID, bloodType, bloodFaction, RH); nw.Show(); this.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void toolStripLabel1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); if (txtName.Text == "" && txtLatinName.Text == "") { MessageBox.Show("من فضلك ادخل البيانات كاملة"); } else { //cmd = new SqlCommand("insert into deleteReason(name,latinName) values (N'" + txtName.Text + "',N'" + txtLatinName.Text + "')", con); cmd = new SqlCommand("bloodBank_deleteReason_insert", connection); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("name", txtName.Text); cmd.Parameters.AddWithValue("latinName", txtLatinName.Text); //MessageBox.Show(txtName.Text + " " + txtLatinName.Text); cmd.ExecuteNonQuery(); MessageBox.Show("تم الاضافة بنجاح"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
private void toolStripButton1_Click(object sender, EventArgs e) { Connection conn = new Connection(); string constr = conn.getconstr(); SqlConnection connection = new SqlConnection(constr); try { connection.Open(); if (tbx_servname.Text == string.Empty) { MessageBox.Show("من فضلك ادخل اسم الاختبار للبحث"); } else { cmd = new SqlCommand("select id,serv_name,price,quantity,notices from analysis_info where serv_name='" + tbx_servname.Text + "'", connection); dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); dataGridView1.DataSource = dt; dr.Close(); dataGridView1.Visible = true; } } catch (Exception ex) { MessageBox.Show(ex.Message); } connection.Close(); }
public administration() { InitializeComponent(); Connection conn = new Connection(); string constr = conn.getconstr(); con = new SqlConnection(constr); }