// DataTable dtprice = new DataTable(); public Patient() { InitializeComponent(); //ChekPrice(); ScreanPriv(); ScreanPrivBond(); //لإظهار رقم المريض ورقم الملف بدون تكرار وبشكل متتابع BL.Cls_Git_Max_id_For_Tables gitmax = new BL.Cls_Git_Max_id_For_Tables(); int Id, No; Id = gitmax.Git_Max_id() + 1; No = gitmax.Git_Max_no() + 1; //بجلب ارقام المريض مع مرقم ملفه تلقائياً txtIdPatient.Text = Id.ToString(); txtNoFile.Text = No.ToString(); //لجلب اسماء العمليات surgeryName(cmTypeBond); BondType(cmBefor); dt = p.SelectAllPatient(); dataGridView1.DataSource = dt; //لجلب اسماء المرضى الى الكبوبوكس sub(txtNamePatient); }
private void txtIdPatient_TextChanged(object sender, EventArgs e) { BL.Cls_Git_Max_id_For_Tables gitmax = new BL.Cls_Git_Max_id_For_Tables(); int Id; Id = gitmax.Git_Max_id() + 1; txtIdPatient.Text = Id.ToString(); }
private void txtNoFile_TextChanged(object sender, EventArgs e) { BL.Cls_Git_Max_id_For_Tables gitmax = new BL.Cls_Git_Max_id_For_Tables(); int No; No = gitmax.Git_Max_no() + 1; //txtNoFile.Text = No.ToString(); }
private void btnBond_Click(object sender, EventArgs e) { try { BL.Cls_Git_Max_id_For_Tables gitmax = new BL.Cls_Git_Max_id_For_Tables(); int id; string user_name; id = Convert.ToInt32(txtIdPatient.Text); user_name = txtNamePatient.Text; //انشاء رقم السند بدون تكررا وبشكل متتابع int idBond; idBond = gitmax.Git_Max_Bond_Book_id() + 1; string open; if (chbxBondState.Checked) { open = "مقفل"; } else { open = "مفتوح"; } double disc = Convert.ToDouble(txtDiscount.Text); if (disc > Properties.Settings.Default.Less_disc) { XtraMessageBox.Show("لايمكن ان يكون التخفيض اكثر من " + Properties.Settings.Default.Less_disc.ToString()); } else { B.InsertBondBook(idBond, cmBefor.SelectedIndex + 1, id, BL.UsersInfo.user_id, Convert.ToDouble(txtAmuont.Text), Convert.ToDouble(txtDiscount.Text), cmbxBondAfterOrCash.Text, open, cmTypeBond.Text, ""); PrintBond(); } //B.InsertBondBook(idBond, bond, Convert.ToInt32(txtIdPatient.Text), BL.UsersInfo.user_id, Convert.ToDouble(txtAmuont.Text), Convert.ToDouble(txtDiscount.Text), cmbxBondAfterOrCash.Text, open); //MessageBox.Show("تم حفظ بيانات السند بنجاح"); /* * vr.documentViewer1.Refresh(); * rp.Parameters["Patient"].Value = Convert.ToInt32(txtIdPatient.Text); * // rp.RequestParameters = false; * * if (rdbtnCheck.Checked) * rp.txtResun.Text = "معايتة"; * else * rp.txtResun.Text = "عملية"; * vr.Show(); */ } catch (Exception) { } }
public void gitmax() { BL.Cls_Git_Max_id_For_Tables gitmax = new BL.Cls_Git_Max_id_For_Tables(); if (string.IsNullOrEmpty(txtIdPatient.Text) || string.IsNullOrEmpty(txtNoFile.Text)) { int Id, No; Id = gitmax.Git_Max_id() + 1; No = gitmax.Git_Max_no() + 1; txtIdPatient.Text = Id.ToString(); txtNoFile.Text = No.ToString(); } }
private void button5_Click(object sender, EventArgs e) { BL.Cls_Git_Max_id_For_Tables gitmax = new BL.Cls_Git_Max_id_For_Tables(); int Id, No; Id = gitmax.Git_Max_id() + 1; No = gitmax.Git_Max_no() + 1; txtIdPatient.Text = Id.ToString(); txtNoFile.Text = No.ToString(); }
private void btnAddPatient_Click(object sender, EventArgs e) { try { // تحديد جنس المريض string sex; if (rdioFemale.Checked) { sex = "انثى"; } else { sex = "ذكر"; } //انشاء رقم المريض بدون تكرار وبشكل متتابع BL.Cls_Git_Max_id_For_Tables gitmax = new BL.Cls_Git_Max_id_For_Tables(); int Id; Id = gitmax.Git_Max_id() + 1; int idBond; idBond = gitmax.Git_Max_Bond_Book_id() + 1; string open; if (chbxBondState.Checked) { open = "مقفل"; } else { open = "مفتوح"; } //التأكد من ان جميع الحقول ممتلئة وليست فارغة if (string.IsNullOrEmpty(txtNamePatient.Text) || string.IsNullOrEmpty(txtAddressPatient.Text) || string.IsNullOrEmpty(txtPhonePatient.Text) || string.IsNullOrEmpty(txtAgePatient.Text) || string.IsNullOrEmpty(txtClinic_id_Patient.Text) || string.IsNullOrEmpty(cmbxBondAfterOrCash.Text) || string.IsNullOrEmpty(txtDiscount.Text) || string.IsNullOrEmpty(txtAmuont.Text)) { MessageBox.Show("قم بتعبئة جميع الحقول", "خطاء", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { // التأكد من رقم العيادة if (!p.Checking_Repeat_ClincID(Convert.ToInt32(txtClinic_id_Patient.Text))) { MessageBox.Show("رقم غير صحيح", "خطاء", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } // التأكد من عدم تكرار رقم الملف if (p.Checking_Repeat_NoFile(Convert.ToInt32(txtNoFile.Text))) { MessageBox.Show("رقم الملف موجود تأكد من صحة الرقم", "خطاء", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { double disc = Convert.ToDouble(txtDiscount.Text); if (disc > Properties.Settings.Default.Less_disc) { XtraMessageBox.Show("لايمكن ان يكون التخفيض اكثر من " + Properties.Settings.Default.Less_disc.ToString()); } else { //دالة الاضافة p.InsertPatient(txtNamePatient.Text, Id, txtAddressPatient.Text, Convert.ToInt32(txtNoFile.Text), txtPhonePatient.Text, txtAgePatient.Text, BL.UsersInfo.user_id, Convert.ToInt32(txtClinic_id_Patient.Text), sex, txtNotePatient.Text); MessageBox.Show("تمت الاضافة بنجاح", "إضافة", MessageBoxButtons.OK, MessageBoxIcon.Information); //var ms = MessageBox.Show() B.InsertBondBook(idBond, cmBefor.SelectedIndex + 1, Id, BL.UsersInfo.user_id, Convert.ToDouble(txtAmuont.Text), Convert.ToDouble(txtDiscount.Text), cmbxBondAfterOrCash.Text, open, cmTypeBond.Text, ""); PrintBond(); PrintFile(); sub(txtNamePatient); Refrsh(); ClearTextPatient(); } } } } catch (SqlException ex) { MessageBox.Show("هناك خطاء تأكد من صحة البيانات" + ex.Message); } }//End/////////////////////////
private void btn_save_after_Click(object sender, EventArgs e) { try { // تحديد جنس المريض string sex; if (rdioFemale.Checked) { sex = "انثى"; } else { sex = "ذكر"; } //انشاء رقم المريض بدون تكرار وبشكل متتابع BL.Cls_Git_Max_id_For_Tables gitmax = new BL.Cls_Git_Max_id_For_Tables(); int Id; Id = gitmax.Git_Max_id() + 1; //التأكد من ان جميع الحقول ممتلئة وليست فارغة if (string.IsNullOrEmpty(txtNamePatient.Text) || string.IsNullOrEmpty(txtAddressPatient.Text) || string.IsNullOrEmpty(txtPhonePatient.Text) || string.IsNullOrEmpty(txtAgePatient.Text) || string.IsNullOrEmpty(txtClinic_id_Patient.Text) || string.IsNullOrEmpty(date_check.Text)) { MessageBox.Show("قم بتعبئة جميع الحقول", "خطاء", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { // التأكد من رقم العيادة if (!p.Checking_Repeat_ClincID(Convert.ToInt32(txtClinic_id_Patient.Text))) { MessageBox.Show("رقم غير صحيح", "خطاء", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } // التأكد من عدم تكرار رقم الملف if (p.Checking_Repeat_NoFile(Convert.ToInt32(txtNoFile.Text))) { MessageBox.Show("رقم الملف موجود تأكد من صحة الرقم", "خطاء", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { //دالة الاضافة p.InsertPatientAfter(txtNamePatient.Text, Id, date_check.Value.Date.ToShortDateString(), txtAddressPatient.Text, Convert.ToInt32(txtNoFile.Text), txtPhonePatient.Text, txtAgePatient.Text, BL.UsersInfo.user_id, Convert.ToInt32(txtClinic_id_Patient.Text), sex, txtNotePatient.Text); MessageBox.Show("تمت الاضافة بنجاح", "إضافة", MessageBoxButtons.OK, MessageBoxIcon.Information); //var ms = MessageBox.Show() //B.InsertBondBook(idBond, cmBefor.SelectedIndex + 1, Id, BL.UsersInfo.user_id, Convert.ToDouble(txtAmuont.Text), Convert.ToDouble(txtDiscount.Text), cmbxBondAfterOrCash.Text, open, cmTypeBond.Text, ""); //PrintBond(); Refrsh(); ClearTextPatient(); //sub(txtNamePatient); } } } catch (SqlException ex) { MessageBox.Show("هناك خطاء تأكد من صحة البيانات" + ex.Message); } }