//********************************حذف********************************************** private void delpatient_Click(object sender, EventArgs e) { try { con.OpenConection(); if (dataGridView1.CurrentCell.RowIndex >= 0) { DialogResult dia = MessageBox.Show("هل انت متاكد من الحذف", "تنبيه", MessageBoxButtons.YesNo); if (dia == DialogResult.Yes) { //object del = new Object(); string[] s = new string[] { "@id" }; string[] s2 = new string[] { dataGridView1.CurrentRow.Cells[0].Value.ToString() }; SqlDbType[] s3 = new SqlDbType[] { SqlDbType.NVarChar }; con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("delpat", s, s2, s3); viewpatient(); textBox1.Text = ""; textBox3.Text = ""; } if (dia == DialogResult.No) { dia = DialogResult.Cancel; textBox1.Text = ""; textBox3.Text = ""; } } } catch (Exception g) { MessageBox.Show(g.Message); } }
private void button1_Click(object sender, EventArgs e) { try { /*string sql = "insert into pre_order values('" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox1.Text + "');"; * * cmd = new SqlCommand(sql, con); * cmd.ExecuteNonQuery();*/ connect.OpenConection(); string pName = "op_orderpre_operation2"; string[] paramNames = { "@var1", "@var2", "@var3", "@var4", "@var5" }; string[] paramValues = { textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text }; SqlDbType[] paramType = { SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar }; connect.ExecuteInsertOrUpdateOrDeleteUsingStoredProc(pName, paramNames, paramValues, paramType); MessageBox.Show("preorder saved is saved"); //textBox1.Text = ""; //textBox2.Text = ""; //textBox3.Text = ""; //textBox4.Text = ""; //textBox5.Text = ""; } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { string[] pramname = new string[3]; string[] pramvalue = new string[3]; SqlDbType[] pramtype = new SqlDbType[3]; pramname[0] = "@x2"; pramname[1] = "@x3"; pramname[2] = "@x4"; pramvalue[0] = patient_Code.Text; pramvalue[1] = monthCalendar1.TodayDate.Date.ToShortDateString(); pramvalue[2] = comboBox2.SelectedItem.ToString(); pramtype[0] = SqlDbType.Int; pramtype[1] = SqlDbType.VarChar; pramtype[2] = SqlDbType.VarChar; if (patient_Code.Text.Equals("") || comboBox2.SelectedItem.Equals("")) { MessageBox.Show("من فضلك ادخل البيانات كاملة "); } else { con.OpenConection(); dataGridView1.DataSource = con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("Hemodialysis_PatientReception_inserte", pramname, pramvalue, pramtype); MessageBox.Show("تم ادخال البيانات بنجاح"); con.CloseConnection(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } //try //{ // //dataGridView1.DataSource = null; // //ds.Tables.Clear(); // //dataGridView1.Rows.Clear(); // //dataGridView1.Refresh(); // con.OpenConection(); // dataGridView1.DataSource = con.ShowDataInGridView("Hemodialysis_PatientReception_select"); //} //catch (Exception ex) //{ // MessageBox.Show(ex.Message); //} }
private void button1_Click(object sender, EventArgs e) { try { con.OpenConection(); int service_code = int.Parse(comboBox3.SelectedItem.ToString()); int deviceCode = int.Parse(comboBox4.SelectedValue.ToString()); string[] pramname = new string[5]; string[] pramvalue = new string[5]; SqlDbType[] pramtype = new SqlDbType[5]; pramname[0] = "@physiotherapy_patient_code"; pramname[1] = "@Device_code"; pramname[2] = "@plan_start"; pramname[3] = "@plan_end"; pramname[4] = "@session_number"; pramvalue[0] = phys_pat_code.ToString(); pramvalue[1] = deviceCode.ToString(); pramvalue[2] = dateTimePicker1.Value.ToString(); pramvalue[3] = dateTimePicker2.Value.ToString(); pramvalue[4] = numericUpDown1.Value.ToString(); pramtype[0] = SqlDbType.Int; pramtype[1] = SqlDbType.Int; pramtype[2] = SqlDbType.Date; pramtype[3] = SqlDbType.Date; pramtype[4] = SqlDbType.Int; con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("physiotherapy_physiotherapy_Treatment_Plan", pramname, pramvalue, pramtype); cmd = new SqlCommand("select plan_code from physiotherapy_Treatment_Plan where physiotherapy_patient_code=" + phys_pat_code, con.returnObject()); String x = cmd.ExecuteScalar().ToString(); int plan_code = int.Parse(x); string[] pramname1 = new string[2]; string[] pramvalue1 = new string[2]; SqlDbType[] pramtype1 = new SqlDbType[2]; pramname1[0] = "@service_code"; pramname1[1] = "@plan_code"; pramvalue1[0] = service_code.ToString(); pramvalue1[1] = plan_code.ToString(); pramtype1[0] = SqlDbType.Int; pramtype1[1] = SqlDbType.Int; con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("physiotherapy_physiotherapy_Treatment_Plan2", pramname1, pramvalue1, pramtype1); string[] pramname2 = new string[2]; string[] pramvalue2 = new string[2]; SqlDbType[] pramtype2 = new SqlDbType[2]; pramname2[0] = "@doc_code"; pramname2[1] = "@plan_code"; pramvalue2[0] = phys_emp_code.ToString(); pramvalue2[1] = plan_code.ToString(); pramtype2[0] = SqlDbType.VarChar; pramtype2[1] = SqlDbType.Int; con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("physiotherapy_physiotherapy_Treatment_Plan3", pramname2, pramvalue2, pramtype2); MessageBox.Show("تم الحفظ"); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { con.CloseConnection(); } }
private void btnRequest_Click(object sender, EventArgs e) { if (txtpatient_code.Text == "" || txtService_code.Text == "" || txtArabic_name.Text == "") { MessageBox.Show("من فضلك قم بإختيار المريض والخدمة المطلوبة من قائمة الخدمات ", "رسالة"); } else { try { c.OpenConection(); string[] para_names = new string[] { "@account_number,@Service_code,@_date,@Quantity " }; string[] para_values = new string[] { txtpatient_code.Text, txtService_code.Text, dateTimePicker1.Text, numericQuantity.Value.ToString() }; SqlDbType [] data_types = new SqlDbType[] { SqlDbType.Int, SqlDbType.Int, SqlDbType.Int, SqlDbType.Date }; c.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("[add_lap_service]", para_names, para_values, data_types); MessageBox.Show("تم إضافة الخدمة بنجاح"); c.CloseConnection(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }
//*******************************اضافة************************** private void addemp_Click(object sender, EventArgs e) { try { con.OpenConection(); if (textBox1.Text != "") { string[] s = new string[] { "@pname" }; string[] s2 = new string[] { textBox1.Text }; SqlDbType[] s3 = new SqlDbType[] { SqlDbType.NVarChar }; con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("insertemp", s, s2, s3); viewemp(); textBox1.Text = ""; textBox16.Text = ""; } else { MessageBox.Show("ادخل الاسم "); } con.CloseConnection(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button1_Click(object sender, EventArgs e) //aaa { try { connect.OpenConection(); for (int i = dataGridView1.Rows.Count - 1; i >= 0; --i) { if (dataGridView1.Rows[i].Selected == true) { string code = dataGridView1.Rows[i].Cells[0].Value.ToString(); string pName = "operation_prep3"; string[] paramNames = { "@op_code" }; string[] paramValues = {code}; SqlDbType[] paramType = { SqlDbType.VarChar }; connect.ExecuteInsertOrUpdateOrDeleteUsingStoredProc(pName, paramNames, paramValues, paramType); MessageBox.Show("تم انهاء العمليه"); } } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
//private void button1_Click(object sender, EventArgs e) //{ // cmd = new SqlCommand("select name as 'الاسم'from employee where emp_id=@x", con); // cmd.Parameters.AddWithValue("@x", textBox1.Text); // SqlDataReader dataReader = cmd.ExecuteReader(); // dataReader.Read(); // textBox2.Text = dataReader[0].ToString(); // dataReader.Close(); //} private void button4_Click(object sender, EventArgs e) { try { if (textBox1.Text.Length == 0) { MessageBox.Show("قم بادخال كود الموظف"); } if (textBox1.Text.Length != 0 & comboBox2.Text.Length == 0) { MessageBox.Show("قم باختيار نوع الاذن"); } string[] s = new string[] { "@x", "@y" }; string[] s2 = new string[] { textBox1.Text, comboBox2.Text }; SqlDbType[] s3 = new SqlDbType[] { SqlDbType.Int, SqlDbType.VarChar }; con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("reg_permits_in", s, s2, s3); //cmd = new SqlCommand("reg_permits_in", con); //cmd.CommandType = CommandType.StoredProcedure; //cmd.Parameters.AddWithValue("@x", textBox1.Text); //cmd.Parameters.AddWithValue("@y", comboBox2.SelectedItem); //cmd.ExecuteNonQuery(); if (textBox1.Text.Length != 0 & comboBox2.Text.Length != 0) { موافق f = new موافق(); f.Show(); } } catch (Exception ee) { MessageBox.Show(ee.Message); } }
private void حفظToolStripMenuItem_Click_1(object sender, EventArgs e) { if (textBox2.Text.Length == 0) { MessageBox.Show("قم بادخال كود الموظف"); } try { string[] s = new string[] { "@x", "@y" }; string[] s2 = new string[] { textBox1.Text, textBox2.Text }; SqlDbType[] s3 = new SqlDbType[] { SqlDbType.VarChar, SqlDbType.Int }; con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("register_leaving_in", s, s2, s3); // cmd = new SqlCommand("register_leaving_in ", con); // cmd.CommandType = CommandType.StoredProcedure; //cmd.Parameters.AddWithValue("@x", textBox1.Text); //cmd.Parameters.AddWithValue("@y", textBox2.Text); // cmd.ExecuteNonQuery(); if (textBox2.Text.Length != 0) { موافق f = new موافق(); f.Show(); } } catch (Exception ee) { MessageBox.Show(ee.Message); } }
private void button3_Click(object sender, EventArgs e) { if (con.State != ConnectionState.Open) { con.Open(); } string describ = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[1].Value.ToString(); string year = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[2].Value.ToString(); string profession_job = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[3].Value.ToString(); string p_state = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[4].Value.ToString(); string date = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[5].Value.ToString(); string employee_state = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[6].Value.ToString(); string p_kind = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[7].Value.ToString(); string j_code = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[8].Value.ToString(); connect.OpenConection(); string pName = "planing_planingJob4"; string[] paramNames = { "@describ", "@year", "@profession_job", "@p_state", "@date", "@employee_state", "@p_kind", "@j_code" }; string[] paramValues = { describ, year, profession_job, p_state, date, employee_state, p_kind, j_code }; SqlDbType[] paramType = { SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar }; connect.ExecuteInsertOrUpdateOrDeleteUsingStoredProc(pName, paramNames, paramValues, paramType); MessageBox.Show("تم الحفظ بنجاح "); }
//*******************************************الاضافة************************************************************* private void btn_add_Click(object sender, EventArgs e) { try { con1.OpenConection(); //****************** check empty fields************************* if (txtarb_des.Text == "" || txteng_des.Text == "") { MessageBox.Show("بعض الحقول فارغة الرجاء اعادة المحاولة"); txteng_des.Text = ""; txtarb_des.Text = ""; } else { //**********************insert into database**************** string[] paramname = new string[] { "@param1", "@param2" }; string[] paramvalue = new string[] { txtarb_des.Text, txteng_des.Text }; SqlDbType[] paramtype = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar }; con1.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("addingcountry", paramname, paramvalue, paramtype); txteng_des.Text = ""; txtarb_des.Text = ""; dis_data(); MessageBox.Show("تمت الاضافة"); } } catch (Exception ee) { MessageBox.Show(ee.Message); } }
private void label6_Click(object sender, EventArgs e) { if (!Class1.chkEmpty(textBox3.Text) && !Class1.chkEmpty(textBox4.Text)) { connect.OpenConection(); string procName = "TRAINING_Insert_CourseList_TrainingCourseName"; string[] paramNames = { " @cl_code", "@cl_name" }; string[] paramValues = { textBox3.Text, textBox4.Text }; SqlDbType[] paramType = { SqlDbType.VarChar }; connect.ExecuteInsertOrUpdateOrDeleteUsingStoredProc(procName, paramNames, paramValues, paramType); /* * connect.ShowDataInGridViewUsingStoredProc(procName); * connect.ShowDataInGridViewUsingStoredProc(procName, paramNames, paramValues, paramType); * connect.ExecuteInsertOrUpdateOrDeleteUsingStoredProc(procName, paramNames, paramValues, paramType); */ connect.CloseConnection(); if (con.State != ConnectionState.Closed) { MessageBox.Show("تم الحفظ بنجاح"); } } else { MessageBox.Show("ادخل البيانات كاملة"); } }
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { con.OpenConection(); string[] pramname = new string[4]; string[] pramvalue = new string[4]; SqlDbType[] pramtype = new SqlDbType[4]; pramname[0] = "@x2"; pramname[1] = "@x3"; pramname[2] = "@x4"; pramname[3] = "@x5"; pramvalue[0] = textBox2.Text.ToString(); pramvalue[1] = textBox3.Text.ToString(); pramvalue[2] = str1; pramvalue[3] = str2; pramtype[0] = SqlDbType.VarChar; pramtype[1] = SqlDbType.VarChar; pramtype[2] = SqlDbType.VarChar; pramtype[3] = SqlDbType.VarChar; if (textBox2.Text.Equals("") || textBox3.Text.Equals("")) { MessageBox.Show("من فضلك ادخل البيانات كاملة "); } else { if (ContainsArabicLetters(textBox2.Text)) { con.OpenConection(); dataGridView1.DataSource = con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("Hemodialysis_Priod_inserte", pramname, pramvalue, pramtype); MessageBox.Show("تم ادخال البيانات بنجاح"); con.CloseConnection(); } else { MessageBox.Show("يرجي ادخال اسم الفتره باللغه العربية"); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } try { con.OpenConection(); dataGridView1.DataSource = con.ShowDataInGridView("Hemodialysis_Priod_select"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
//**************************************الاضافة******************************************************************* private void btn_add_Click(object sender, EventArgs e) { try { con1.OpenConection(); SqlDataReader dr; //****************** check empty fields************************* if (txtId.Text == "" || txtarb_des.Text == "" || txteng_des.Text == "") { MessageBox.Show("بعض الحقول فارغة الرجاء اعادة المحاولة"); txtId.Text = ""; txtarb_des.Text = ""; txteng_des.Text = ""; cb_patientstatus.Text = ""; cb_type.Text = ""; chb_defualt.Checked = false; } //**********************check dublicated ID********************* else { con1.OpenConection(); dr = (SqlDataReader)con1.DataReader("select Id from reasons_of_exit where Id=" + txtId.Text); if (dr.HasRows) { MessageBox.Show(" هذا الكود موجود بالفعل حاول مرة اخرى"); txtId.Text = ""; txtarb_des.Text = ""; txteng_des.Text = ""; cb_patientstatus.Text = ""; cb_type.Text = ""; chb_defualt.Checked = false; } //**********************insert into database**************** else { dr.Close(); string[] paramname = new string[] { "@param1", "@param2", "@param3", "@param4", "@param5", "@param6" }; string[] paramvalue = new string[] { txtId.Text, txtarb_des.Text, txteng_des.Text, cb_patientstatus.Text, cb_type.Text, chb_defualt.Checked.ToString() }; SqlDbType[] paramtype = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Bit }; con1.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("addingreasons_of_exit1", paramname, paramvalue, paramtype); txtId.Text = ""; txtarb_des.Text = ""; txteng_des.Text = ""; cb_patientstatus.Text = ""; cb_type.Text = ""; chb_defualt.Checked = false; dis_data(); MessageBox.Show("تمت الاضافة"); } } } catch (Exception ee) { MessageBox.Show(ee.Message); } }
private void dataGridView1_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { dataGridView2.DataSource = null; ds.Tables.Clear(); dataGridView2.Rows.Clear(); dataGridView2.Refresh(); //////////////////// for (int i = dataGridView1.Rows.Count - 1; i >= 0; --i) { if (dataGridView1.Rows[i].Selected == true) { code = dataGridView1.Rows[i].Cells[0].Value.ToString(); } } if (comboBox1.SelectedItem.ToString() == "Doctor") { string pName = "op_teamWork5"; string[] paramNames = { "@code", "@a" }; string[] paramValues = { code, اعدادات_متقدمه_للعمليه.y }; SqlDbType[] paramType = { SqlDbType.VarChar, SqlDbType.VarChar }; connect.ExecuteInsertOrUpdateOrDeleteUsingStoredProc(pName, paramNames, paramValues, paramType); MessageBox.Show("تم ادخال دكنور"); string[] paramNames1 = { "@doc_ssn" }; string[] paramValues1 = { code }; SqlDbType[] paramType1 = { SqlDbType.VarChar }; dataGridView2.DataSource = connect.ShowDataInGridViewUsingStoredProc("op_teamWork6", paramNames1, paramValues1, paramType1); } else if (comboBox1.SelectedItem.ToString() == "Nurse") { dataGridView3.DataSource = null; ds.Tables.Clear(); dataGridView3.Rows.Clear(); dataGridView3.Refresh(); string pName = "op_teamWork7"; string[] paramNames = { "@code", "@x" }; string[] paramValues = { code, اعدادات_متقدمه_للعمليه.y }; SqlDbType[] paramType = { SqlDbType.VarChar, SqlDbType.VarChar }; connect.ExecuteInsertOrUpdateOrDeleteUsingStoredProc(pName, paramNames, paramValues, paramType); MessageBox.Show(code); MessageBox.Show("تم ادخال ممرض"); string[] paramNames1 = { "@employee_emp_id" }; string[] paramValues1 = { code }; SqlDbType[] paramType1 = { SqlDbType.VarChar }; dataGridView3.DataSource = connect.ShowDataInGridViewUsingStoredProc("op_teamWork8", paramNames1, paramValues1, paramType1); } //dataGridView2.Rows[e.RowIndex].Cells[0].Value.ToString(); }
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { string[] pramname = new string[5]; string[] pramvalue = new string[5]; SqlDbType[] pramtype = new SqlDbType[5]; pramname[0] = "@x2"; pramname[1] = "@x3"; pramname[2] = "@x4"; pramname[3] = "@x5"; pramname[4] = "@x6"; pramvalue[0] = patient_code.Text; pramvalue[1] = doc_type.Text; pramvalue[2] = Room_Num.Text; pramvalue[3] = Service_Code.Text; pramvalue[4] = str; pramtype[0] = SqlDbType.Int; pramtype[1] = SqlDbType.Int; pramtype[2] = SqlDbType.Int; pramtype[3] = SqlDbType.Int; pramtype[4] = SqlDbType.VarChar; if (patient_code.Text.Equals("") || doc_type.Text.Equals("") || Room_Num.Text.Equals("") || Service_Code.Text.Equals("")) { MessageBox.Show("من فضلك ادخل البيانات كاملة "); } else { con.OpenConection(); dataGridView1.DataSource = con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("Hemodialysis_Plan_inserte", pramname, pramvalue, pramtype); MessageBox.Show("تم ادخال البيانات بنجاح"); con.CloseConnection(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } try { con.OpenConection(); dataGridView1.DataSource = con.ShowDataInGridView("Hemodialysis_Plan_select"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void label17_Click(object sender, EventArgs e) { if (textBox3.Text == "" || textBox2.Text == "" || textBox4.Text == "" || textBox5.Text == "" || textBox6.Text == "" || dateTimePicker1.Value == null || comboBox1.SelectedItem == null) { MessageBox.Show("بعض الخانات مفقودة !"); return; } try { sqlCon.OpenConection(); String[] a = { "@code1", "@maintenance_date1", "@visit_number1", "@visit_type1", "@responsible_engineer1", "@visit_report1", "@recommendations1" }; String[] b = { comboBox1.SelectedValue.ToString(), dateTimePicker1.Value.ToString(), textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text }; SqlDbType[] c = { SqlDbType.Int, SqlDbType.Date, SqlDbType.VarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar }; sqlCon.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("maintinance1", a, b, c); MessageBox.Show("تمت اضافة الصيانة"); this.Hide(); } catch (NullReferenceException ex) { MessageBox.Show("ادخل جميع البيانات"); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { sqlCon.CloseConnection(); } }
private void ts_btn_save_Click(object sender, EventArgs e) { string[] pramname = new string[5]; string[] pramvalue = new string[5]; SqlDbType[] pramtype = new SqlDbType[5]; pramname[0] = "@id_anatomy"; pramname[1] = "@treatment"; pramname[2] = "@notes"; pramname[3] = "@visit_id"; pramname[4] = "@diagnosis_id"; pramvalue[0] = anatomy; pramvalue[1] = txt_treatment.Text; pramvalue[2] = txt_notes.Text; pramvalue[3] = vis_id; pramvalue[4] = diagnosis; pramtype[0] = SqlDbType.Int; pramtype[1] = SqlDbType.NVarChar; pramtype[2] = SqlDbType.NVarChar; pramtype[3] = SqlDbType.NVarChar; pramtype[4] = SqlDbType.Int; if (con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("doc_instruction_insert", pramname, pramvalue, pramtype)) { MessageBox.Show("تمت الاضافة بنجاح ", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Information); } dt = new DataTable(); dt = con.selectt("select [dbo].[diagnosis].name,[dbo].[anatomy].name,[treatment],[notes] from [dbo].[diagnosis],[dbo].[anatomy],[dbo].[doc_instruction] where [dbo].[doc_instruction].diagnosis_id=[dbo].[diagnosis].id and [dbo].[doc_instruction].id_anatomy=[dbo].[anatomy].id and [dbo].[doc_instruction].Visit_id='" + vis_id + "'"); if (dt.Rows.Count > 0) { dgv_doc_inst.DataSource = dt; dgv_doc_inst.Columns[0].HeaderText = "التشخيص"; dgv_doc_inst.Columns[1].HeaderText = "التحليل"; dgv_doc_inst.Columns[2].HeaderText = "العلاج"; dgv_doc_inst.Columns[3].HeaderText = "ملاحظات"; } }
private void label17_Click(object sender, EventArgs e) { if (textBox2.Text == "" || textBox3.Text == "") { MessageBox.Show("بعض الخانات مفقودة !"); return; } try { sqlCon.OpenConection(); String[] a = { "@code", "@arabic", "@latin" }; String[] b = { textBox1.Text, textBox2.Text, textBox3.Text }; SqlDbType[] c = { SqlDbType.Int, SqlDbType.NVarChar, SqlDbType.NVarChar }; sqlCon.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("add_Category", a, b, c); MessageBox.Show("تمت الاضافة بنجاح"); this.Hide(); } catch (Exception ee) { MessageBox.Show(ee.Message); } finally { sqlCon.CloseConnection(); } }
private void button3_Click(object sender, EventArgs e) { try { connect.OpenConection(); string d = comboBox3.Items[comboBox3.SelectedIndex].ToString(); string op_type = comboBox1.Items[comboBox3.SelectedIndex].ToString(); string ss = "no"; string s = dateTimePicker1.Value.ToShortDateString(); string pName = "operation_reservation2"; string[] paramNames = { "@doc_ssn", "@visit_id", "@req_date ", "@op_name", "@r_side", "@req_periority", "@r_status", "@op_type" }; string[] paramValues = { textBox3.Text, textBox1.Text, dateTimePicker1.Value.ToShortDateString(), textBox6.Text, d, periority, ss, op_type }; SqlDbType[] paramType = { SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar }; connect.ExecuteInsertOrUpdateOrDeleteUsingStoredProc(pName, paramNames, paramValues, paramType); /* * string sql = "insert into requests(r_acceptance_date,doc_ssn,visit_id,req_date,op_suite_name,r_status ,req_periority)values (null,'"; * sql += textBox3.Text + "','"; * sql += textBox1.Text + "','" + dateTimePicker1.Value.ToShortDateString() + "','"; * * sql += comboBox2.Items[comboBox2.SelectedIndex] + "','no'" + ",'"; * sql += periority +"')"; * cmd = new SqlCommand(sql, con); * cmd.ExecuteNonQuery();*/ MessageBox.Show("requests is saved"); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
private void button1_Click(object sender, EventArgs e) { try { if (textBox2.Text.Length == 0 && textBox3.Text.Length == 0) { MessageBox.Show("قم بادخال البيانات"); } string[] s = new string[] { "@x", "@y" }; string[] s2 = new string[] { textBox3.Text, textBox2.Text }; SqlDbType[] s3 = new SqlDbType[] { SqlDbType.VarChar, SqlDbType.VarChar }; con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("reg_method_attending_leaving1", s, s2, s3); //cmd = new MySqlCommand("insert into methods_attending_leaving set attending_method=@x,short_name=@y,attend_method=@z", con); //cmd.Parameters.AddWithValue("@x", textBox3.Text); //cmd.Parameters.AddWithValue("@y", textBox2.Text); //cmd.Parameters.AddWithValue("@z", comboBox1.SelectedItem); //cmd.ExecuteNonQuery(); if (textBox2.Text.Length != 0 && textBox3.Text.Length != 0) { موافق f = new موافق(); f.Show(); } } catch (Exception ee) { MessageBox.Show(ee.Message); } }
private void اضافةToolStripMenuItem_Click(object sender, EventArgs e) { Regex r = new Regex("^[0-9]"); int q = int.Parse(textBox1.Text); if (r.Match(textBox1.Text).Success == true) { if (med_id != string.Empty) { Connection con = new Connection(); con.OpenConection(); DateTime date, date1; date = dateTimePicker1.Value; date1 = dateTimePicker2.Value; con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("pharamacy_insert_into_medicine_oredr", new string[] { "@med_id", "@order_date", "@med_quantity", "@order_need_date " }, new string[] { med_id.ToString(), date.ToString(), q.ToString(), date1.ToString() }, new SqlDbType[] { SqlDbType.Int, SqlDbType.Date, SqlDbType.Int, SqlDbType.Date }); } else { MessageBox.Show("من فضلك اختر طلب علي الاقل"); } } else { MessageBox.Show("يجب ادخال الكميه بالارقام"); } }
private void button1_Click(object sender, EventArgs e) { try { connect.OpenConection(); string pName = "planing_organiz_struc2"; string[] paramNames = { "@year", "@target_num", "@existStaff_num", "@estimated_salary" }; string[] paramValues = { textBox5.Text, textBox1.Text, textBox3.Text, textBox2.Text }; SqlDbType[] paramType = { SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar }; connect.ExecuteInsertOrUpdateOrDeleteUsingStoredProc(pName, paramNames, paramValues, paramType); /* * connect.ShowDataInGridViewUsingStoredProc(pName); * connect.ShowDataInGridViewUsingStoredProc(pName, paramNames, paramValues, paramType); * connect.ExecuteInsertOrUpdateOrDeleteUsingStoredProc(pName, paramNames, paramValues, paramType); */ MessageBox.Show("تم الاضافه "); } catch (Exception ee) { MessageBox.Show(ee.Message); } connect.CloseConnection(); }
private void label7_Click(object sender, EventArgs e) { if (comboBox2.SelectedItem == null || dateTimePicker1.Value == null) { MessageBox.Show("بعض الخانات مفقودة !"); return; } try { sqlCon.OpenConection(); String[] a = { "@asset_code1", "@re_evaluation_date1", "@current_value1", "@new_value1", "@reason_code1", "@notes1" }; String[] b = { comboBox2.SelectedValue.ToString(), dateTimePicker1.Value.ToShortDateString(), textBox1.Text, textBox3.Text, comboBox1.SelectedValue.ToString(), richTextBox1.Text }; SqlDbType[] c = { SqlDbType.Int, SqlDbType.Date, SqlDbType.Float, SqlDbType.Float, SqlDbType.Int, SqlDbType.NVarChar }; sqlCon.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("re_evaluate", a, b, c); MessageBox.Show("تم اضافة التقييم"); this.Hide(); } catch (NullReferenceException ee) { MessageBox.Show("ادخل جميع البيانات"); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { sqlCon.CloseConnection(); } }
private void label21_Click(object sender, EventArgs e) { try { con.OpenConection(); string[] pramname = new string[1]; string[] pramvalue = new string[1]; SqlDbType[] pramtype = new SqlDbType[1]; pramname[0] = "@id"; pramvalue[0] = textBox1.Text;; pramtype[0] = SqlDbType.Int; if (textBox1.Text == "") { MessageBox.Show("من فضلك ادخل رقم المورد"); } else { dataGridView1.DataSource = con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("dele", pramname, pramvalue, pramtype); MessageBox.Show("deleted"); } //con.Open(); //SqlCommand cmd = new SqlCommand("delesup", con); //cmd.CommandType = CommandType.StoredProcedure; ////cmd.Prepare(); //cmd.Parameters.AddWithValue("@id", textBox1.Text); //cmd.Connection = con; //cmd.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { con.CloseConnection(); } }
private void اضافةToolStripMenuItem_Click(object sender, EventArgs e) { Regex num = new Regex("^[0-9]"); Regex txt = new Regex("(?i)^[a-z]+"); if (num.Match(txtQuantity.Text).Success&& num.Match(txtPrice.Text).Success&& txt.Match(txtDawa3i.Text).Success&& txt.Match(txtFa3ala.Text).Success&& txt.Match(txrArabicName.Text).Success&& txt.Match(txtmethod.Text).Success) { Connection conn = new Connection(); conn.OpenConection(); int quantity = int.Parse(txtQuantity.Text); float price = float.Parse(txtPrice.Text); string name = txrArabicName.Text; string mada = txtFa3ala.Text; string use = txtDawa3i.Text; string taking = txtmethod.Text; DateTime date = dateTimePicker1.Value; conn.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("pharmacy_insert_medicine", new string[] { "@quantity", "@med_name", "@eff_subject", "@useability", "@price", "@taking_meth", "@ex_date" }, new string[] { quantity.ToString(), name, mada, use, price.ToString(), taking, date.ToString() }, new SqlDbType[] { SqlDbType.Int, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Float, SqlDbType.NVarChar, SqlDbType.Date }); MessageBox.Show("تمت الاضافه"); } else { MessageBox.Show("يجب ادخال بينانات صحيحة"); } }
private void label2_Click(object sender, EventArgs e) { connect.OpenConection(); string procName = "Traing_SureStartTrainingCourse"; string[] paramNames = { "@course_code " }; string[] paramValues = { textBox6.Text }; SqlDbType[] paramType = { SqlDbType.VarChar }; connect.ExecuteInsertOrUpdateOrDeleteUsingStoredProc(procName, paramNames, paramValues, paramType); /* * connect.ShowDataInGridViewUsingStoredProc(procName); * connect.ShowDataInGridViewUsingStoredProc(procName, paramNames, paramValues, paramType); * connect.ExecuteInsertOrUpdateOrDeleteUsingStoredProc(procName, paramNames, paramValues, paramType); */ connect.CloseConnection(); if (!Class1.chkEmpty(textBox6.Text) && !Class1.chkEmpty(textBox5.Text)) { MessageBox.Show("تم تاكيد الدورة "); } else { MessageBox.Show("ادخل البيانات كاملة"); } }
private void label17_Click(object sender, EventArgs e) { if (textBox2.Text == "" || comboBox1.SelectedItem == null || dateTimePicker1.Value == null || ((!radioButton1.Checked || comboBox8.SelectedItem == null) && (!radioButton2.Checked || comboBox9.SelectedItem == null))) { MessageBox.Show("بعض الخانات مفقودة !"); return; } try{ sqlcon.OpenConection(); String[] a = { "@code", "@code_transaction", "@to_place", "@to_kind", "@transmit_date" }; String[] b = { comboBox1.SelectedValue.ToString(), textBox2.Text, "t1", "t2", dateTimePicker1.Value.ToString() }; SqlDbType[] c = { SqlDbType.Int, SqlDbType.Int, SqlDbType.Int, SqlDbType.NVarChar, SqlDbType.Date }; if (to_kin == 0) { b[2] = comboBox8.SelectedValue.ToString(); b[3] = "مخزن"; } else { b[2] = comboBox9.SelectedValue.ToString(); b[3] = "قسم"; } sqlcon.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("asset_movement", a, b, c); MessageBox.Show("تم نقل الاصل"); this.Hide(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { sqlcon.CloseConnection(); } }
private void button4_Click(object sender, EventArgs e) { Connection con = new Connection(); con.OpenConection(); string[] param_names = new string[] { "@doc_code" // كود الدكتور فورن كي من الدكتور , "@inventry_id " // كود الزياره من جدول الزياره , "@follow_up_sheet_date " // تاريخ الروشته , "@observer_doctor" // اسم الدكتور اللي كتب الروشته , "@examination_notes" // الملاحظات الطبيه في الروشته , "@medicin " // الادويه , "@sol " // التحاليل , "@investigation" // التشخيص // المنظار مش عارفه فين , "@operations " // العمليات , "@rays" // الاشعه }; // الامراض الوراثسيه والعائليه للمريض //@doc_code @age اسم الدكتور @name اسمالمريض @iventry id @date @present @past @family string[] param_values = new string[] { textBox3.Text, textBox4.Text, dateTimePicker1.Value.ToString("yyyy-MM-dd"), comboBox7.SelectedItem.ToString(), textBox1.Text, listBox3.Items.ToString(), listBox4.Items.ToString(), listBox6.Items.ToString(), listBox5.Items.ToString(), listBox1.Items.ToString() }; SqlDbType[] param_types = new SqlDbType[] { SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.Date, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar }; con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("insert_follow_up_sheet", param_names, param_values, param_types); validation v = new validation(); }
private void label17_Click(object sender, EventArgs e) { if (textBox2.Text == "" || textBox5.Text == "" || textBox7.Text == "" || textBox3.Text == "" || comboBox1.SelectedItem.ToString() == "" || comboBox2.SelectedValue == null || comboBox3.SelectedValue == null || comboBox4.SelectedValue == null) { MessageBox.Show("بعض الخانات مفقودة !"); return; } try { sqlCon.OpenConection(); String[] paramName = { "@code", "@latin_description1", "@arabic_description1", "@annual_depreciation_rate1", "@stop_depreciation_at1", "@depreciation_method1", "@ac1", "@ac2", "@ac3" }; String[] x = { textBox1.Text, textBox3.Text, textBox2.Text, textBox5.Text, textBox7.Text, comboBox1.SelectedValue.ToString(), comboBox2.SelectedValue.ToString(), comboBox3.SelectedValue.ToString(), comboBox4.SelectedValue.ToString() }; SqlDbType[] y = { SqlDbType.Int, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Float, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar }; sqlCon.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("add_sub", paramName, x, y); MessageBox.Show("تم الاضافة بنجاح"); this.Hide(); } catch (Exception ee) { MessageBox.Show(ee.Message); } finally { sqlCon.CloseConnection(); } }