//تعديل مريض private void BtnUpdatePatient_Click(object sender, EventArgs e) { if (txtPatientID.TextLength > 0) { if (Application.OpenForms.OfType <frmPatientsCRUD>().Any()) { return; } else { new frmPatientsCRUD(null, new List <string>(), int.Parse(txtPatientID.Text), null).Show(); } } VisitsLogic.PatientInfo(new List <TextBox>() { txtPatientID, txtPatientName, txtPatientPhone }); }
//Get Patient Info private void PatientGroupBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { try { VisitsLogic.PatientInfo(new List <TextBox>() { txtPatientID, txtPatientName, txtPatientPhone }); //شوف لو علية فلوس //1-هات الفيزيت اي دي //2-هات الفلوس اللى علية بالفيزيت اي دي دة /*-------------------------------*/ int visitID = getVisitID_To_Check_Payment(txtPatientName.Text); if (Payment.get_Required_Payment(visitID) != Payment.get_Previous_Payment(visitID)) { DialogResult Dialog = MessageBox.Show("المريض علية فلوس هل تريد تدفع ؟", "تنبيه", MessageBoxButtons.YesNo); if (Dialog == DialogResult.Yes) { //افتح فورمه الدفع و باصيلها الفيزيت اي دي if (Application.OpenForms.OfType <frmPaymentCRUD>().Any()) { return; } else { new frmPaymentCRUD(null, new List <string>(), visitID, int.Parse(txtPatientID.Text)).Show(); } } } /*-------------------------------*/ //disable textboxes ValidationMethods.Enable_DisableTextBoxes(new List <TextBox>() { txtPatientID, txtPatientName, txtPatientPhone }, false); //check if reservation exists, if yes : insert reciption time if (CheckForVisit(int.Parse(txtPatientID.Text))) { DialogResult Dialog = MessageBox.Show("تسجيل حضور المريض ؟", "تنبيه", MessageBoxButtons.YesNo); if (Dialog == DialogResult.Yes) { RegisterVisit(); VisitsLogic.PopulateListBox(listbxWaitingQueue); BtnNewReservation_Click(sender, e); if (listbxWaitingQueue.Items.Count == 1) { btnUp.Enabled = false; btnDown.Enabled = false; } else { btnUp.Enabled = true; btnDown.Enabled = true; } } else { BtnNewReservation_Click(sender, e); } } } catch (Exception) { DialogResult Dialog = MessageBox.Show("مريض غير موجود، هل تود اضافة هذا المريض الان؟", "تنبيه", MessageBoxButtons.YesNo); if (Dialog == DialogResult.Yes) { //افتح شاشة اضافة مريض (دوس على الزرار يعني) btnInsertPatient_Click(sender, e); } } } }