private void btnPaymentDelete_Click(object sender, EventArgs e) { string patientid = txtPaymentPatientID.Text; int registrationfee = 0; if (chkboxPaymentNewPatient.Checked == true) { PatientDBO pdbo2 = new PatientDBO(); Patient patient = pdbo2.findPatient(patientid); lblPaymentRegistrationFee.Text = "Registration Fee:- " + patient.getRegistrationFee().ToString(); registrationfee = patient.getRegistrationFee(); } else if (chkboxPaymentNewPatient.Checked == false) { lblPaymentRegistrationFee.Text = " "; registrationfee = 0; } ; string treatmentcode = txtPaymentTreatmentCode.Text; TreatmentDBO tdbo = new TreatmentDBO(); Treatment treatment = tdbo.findCharges(treatmentcode); lblPaymentDoctorsCharge.Text = "Doctor's charge:- " + treatment.getDoctorsCharge().ToString(); lblPaymentStandardFee.Text = "Treatment Standard Fee:- " + treatment.getStandardFee().ToString(); lblPaymentTotalCharge.Text = "Total Charge:- " + (treatment.getDoctorsCharge() + registrationfee + treatment.getStandardFee()).ToString(); int doctorscharge = treatment.getDoctorsCharge(); int treatmentfee = treatment.getStandardFee(); int totalcharge = treatment.getDoctorsCharge() + treatment.getStandardFee() + registrationfee; PaymentDBO pdbo = new PaymentDBO(); string invoiceno = txtPaymentInvoiceNo.Text; //string patientid = txtPaymentPatientID.Text; (temp) string paymentmode = "None"; if (rdobtnPaymentCash.Checked == true) { paymentmode = "Cash"; } else if (rdobtnPaymentCreditCard.Checked == true) { paymentmode = "Credit Card"; } else if (rdobtnPaymentCheque.Checked == true) { paymentmode = "Cheque"; } ; Payment payment = new Payment(invoiceno, treatmentcode, patientid, paymentmode, doctorscharge, treatmentfee, totalcharge, registrationfee); pdbo.deletePaymentInfo(payment); MessageBox.Show("The invoice & it's payment information has been removed.", "Delete Success!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); txtPaymentInvoiceNo.Text = ""; txtPaymentTreatmentCode.Text = ""; txtPaymentPatientID.Text = ""; rdobtnPaymentCash.Checked = false; rdobtnPaymentCheque.Checked = false; chkboxPaymentNewPatient.Checked = false; rdoBtnsasas.Checked = false; rdobtnPaymentCreditCard.Checked = false; lblPaymentTreatmentType.Text = ""; lblPaymentPatientName.Text = ""; lblPaymentDoctorsCharge.Text = "Doctor's charge:- "; lblPaymentStandardFee.Text = "Treatment Standard Fee:- "; lblPaymentTotalCharge.Text = "Total Charge:- "; lblPaymentRegistrationFee.Text = "Registration Fee:- "; }
private void txtDentalTreatmentPatientID_TextChanged(object sender, EventArgs e) { try { string patientid = txtPaymentPatientID.Text; PatientDBO pdbo = new PatientDBO(); Patient patient = pdbo.findPatient(patientid); lblPaymentPatientName.ForeColor = Color.Black; lblPaymentPatientName.Text = patient.getFirstName() + " " + patient.getSurname(); } catch { lblPaymentPatientName.ForeColor = Color.Red; lblPaymentPatientName.Text = "Invalid Patient ID"; } }
private void btnPatientRegistrationUpdate_Click(object sender, EventArgs e) { PatientDBO pdbo = new PatientDBO(); string patientid = txtPatientRegistrationPatientID.Text; string fname = txtPatientRegistrationFirstName.Text; string surname = txtPatientRegistrationSurname.Text; string address = txtPatientRegistrationAddress.Text; string nic = txtPatientRegistrationNIC.Text; int contactno = int.Parse(txtPatientRegistrationContactNo.Text.Trim()); int registrationfee = int.Parse(txtPatientRegistrationRegistrationFee.Text.Trim()); Patient patient = new Patient(patientid, fname, surname, address, nic, contactno, registrationfee); pdbo.updatePatientInfo(patient); MessageBox.Show("Changes made to the patient's record has been updated.", "Edit Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void btnPatientRegistrationDelete_Click(object sender, EventArgs e) { PatientDBO pdbo = new PatientDBO(); string patientid = txtPatientRegistrationPatientID.Text; string fname = txtPatientRegistrationFirstName.Text; string surname = txtPatientRegistrationSurname.Text; string address = txtPatientRegistrationAddress.Text; string nic = txtPatientRegistrationNIC.Text; int contactno = int.Parse(txtPatientRegistrationContactNo.Text.Trim()); int registrationfee = int.Parse(txtPatientRegistrationRegistrationFee.Text.Trim()); Patient patient = new Patient(patientid, fname, surname, address, nic, contactno, registrationfee); pdbo.deletePatientInfo(patient); MessageBox.Show("The patient's record & it's information has been removed.", "Delete Success!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); txtPatientRegistrationPatientID.Text = ""; txtPatientRegistrationFirstName.Text = ""; txtPatientRegistrationSurname.Text = ""; txtPatientRegistrationAddress.Text = ""; txtPatientRegistrationNIC.Text = ""; txtPatientRegistrationContactNo.Text = ""; txtPatientRegistrationRegistrationFee.Text = ""; }
private void btnPatientRegistrationSearchPatient_Click(object sender, EventArgs e) { try { string patientid = txtPatientRegistrationPatientID.Text; PatientDBO pdbo = new PatientDBO(); Patient patient = pdbo.findPatient(patientid); txtPatientRegistrationPatientID.Text = patient.getPatientID(); txtPatientRegistrationFirstName.Text = patient.getFirstName(); txtPatientRegistrationSurname.Text = patient.getSurname(); txtPatientRegistrationAddress.Text = patient.getAddress(); txtPatientRegistrationNIC.Text = patient.getNIC(); txtPatientRegistrationContactNo.Text = patient.getContactNo().ToString(); txtPatientRegistrationRegistrationFee.Text = patient.getRegistrationFee().ToString(); } catch (Exception ex) { MessageBox.Show("Couldn't find any records or details of such a Patient.", "Incorrect Entry", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnPatientRegistrationSave_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(txtPatientRegistrationContactNo.Text)) { MessageBox.Show("The contact number should be entered.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (txtPatientRegistrationContactNo.TextLength <= 9) { MessageBox.Show("The contact number should have 10 digits.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (string.IsNullOrWhiteSpace(txtPatientRegistrationPatientID.Text)) { MessageBox.Show("A patient ID should be entered.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { try { PatientDBO pdbo = new PatientDBO(); string patientid = txtPatientRegistrationPatientID.Text; string fname = txtPatientRegistrationFirstName.Text; string surname = txtPatientRegistrationSurname.Text; string address = txtPatientRegistrationAddress.Text; string nic = txtPatientRegistrationNIC.Text; int contactno = int.Parse(txtPatientRegistrationContactNo.Text.Trim()); int registrationfee = int.Parse(txtPatientRegistrationRegistrationFee.Text.Trim()); Patient patient = new Patient(patientid, fname, surname, address, nic, contactno, registrationfee); pdbo.patientInfo(patient); MessageBox.Show("The new patient's information was added successfully.", "Save Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex2) { MessageBox.Show("This Patient's ID has already been entered.", "Duplicate Entry", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnPaymentSave_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(txtPaymentInvoiceNo.Text)) { MessageBox.Show("An Invoice No should be entered.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (string.IsNullOrWhiteSpace(txtPaymentTreatmentCode.Text)) { MessageBox.Show("The treatment ID should be entered.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (string.IsNullOrWhiteSpace(txtPaymentPatientID.Text)) { MessageBox.Show("The patient's ID should be entered.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { string patientid = txtPaymentPatientID.Text; int registrationfee = 0; if (chkboxPaymentNewPatient.Checked == true) { PatientDBO pdbo2 = new PatientDBO(); Patient patient = pdbo2.findPatient(patientid); lblPaymentRegistrationFee.Text = "Registration Fee:- " + patient.getRegistrationFee().ToString(); registrationfee = patient.getRegistrationFee(); } else if (chkboxPaymentNewPatient.Checked == false) { lblPaymentRegistrationFee.Text = " "; registrationfee = 0; } ; string treatmentcode = txtPaymentTreatmentCode.Text; TreatmentDBO tdbo = new TreatmentDBO(); Treatment treatment = tdbo.findCharges(treatmentcode); lblPaymentDoctorsCharge.Text = "Doctor's charge:- " + treatment.getDoctorsCharge().ToString(); lblPaymentStandardFee.Text = "Treatment Standard Fee:- " + treatment.getStandardFee().ToString(); lblPaymentTotalCharge.Text = "Total Charge:- " + (treatment.getDoctorsCharge() + registrationfee + treatment.getStandardFee()).ToString(); int doctorscharge = treatment.getDoctorsCharge(); int treatmentfee = treatment.getStandardFee(); int totalcharge = treatment.getDoctorsCharge() + treatment.getStandardFee() + registrationfee; try { PaymentDBO pdbo = new PaymentDBO(); string invoiceno = txtPaymentInvoiceNo.Text; //string patientid = txtPaymentPatientID.Text; (temp) string paymentmode = "None"; if (rdobtnPaymentCash.Checked == true) { paymentmode = "Cash"; } else if (rdobtnPaymentCreditCard.Checked == true) { paymentmode = "Credit Card"; } else if (rdobtnPaymentCheque.Checked == true) { paymentmode = "Cheque"; } ; Payment payment = new Payment(invoiceno, treatmentcode, patientid, paymentmode, doctorscharge, treatmentfee, totalcharge, registrationfee); pdbo.paymentInfo(payment); MessageBox.Show("Payment information has been recorded successfully.", "Save Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex2) { MessageBox.Show("This Invoice ID has already been generated.", "Duplicate Entry", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }