示例#1
0
        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:-                     ";
        }
示例#2
0
 private void txtPaymentTreatmentCode_TextChanged(object sender, EventArgs e)
 {
     try
     {
         string       treatmentcode = txtPaymentTreatmentCode.Text;
         TreatmentDBO tdbo          = new TreatmentDBO();
         Treatment    treatment     = tdbo.findCharges(treatmentcode);
         lblPaymentTreatmentType.ForeColor = Color.Black;
         lblPaymentTreatmentType.Text      = treatment.getTreatmentType();
     }
     catch
     {
         lblPaymentTreatmentType.ForeColor = Color.Red;
         lblPaymentTreatmentType.Text      = "Invalid Treatment Code";
     }
 }
示例#3
0
        private void btnDentalTreatmentUpdate_Click_1(object sender, EventArgs e)
        {
            TreatmentDBO tdbo             = new TreatmentDBO();
            string       treatmentcode    = txtDentalTreatmentTreatmentCode.Text;
            string       treatmenttype    = txtDentalTreatmentTreatmentType.Text;
            string       treatmentdetails = txtDentalTreatmentTreatmentDetails.Text;
            string       doctorid         = txtDentalTreatmentDoctorID.Text;
            string       patientid        = txtDentalTreatmentPatientID.Text;
            int          standardfee      = int.Parse(txtDentalTreatmentStandardFee.Text.Trim());
            int          doctorscharge    = int.Parse(txtDentalTreatmentDoctorsCharge.Text.Trim());

            Treatment treatment = new Treatment(treatmentcode, treatmenttype, treatmentdetails, doctorid, patientid, standardfee, doctorscharge);

            tdbo.updateTreatmentInfo(treatment);
            MessageBox.Show("Changes made to the dental treatment record has been updated.", "Edit Success!", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
示例#4
0
        private void btnDentalTreatmentDelete_Click_1(object sender, EventArgs e)
        {
            TreatmentDBO tdbo             = new TreatmentDBO();
            string       treatmentcode    = txtDentalTreatmentTreatmentCode.Text;
            string       treatmenttype    = txtDentalTreatmentTreatmentType.Text;
            string       treatmentdetails = txtDentalTreatmentTreatmentDetails.Text;
            string       doctorid         = txtDentalTreatmentDoctorID.Text;
            string       patientid        = txtDentalTreatmentPatientID.Text;
            int          standardfee      = int.Parse(txtDentalTreatmentStandardFee.Text.Trim());
            int          doctorscharge    = int.Parse(txtDentalTreatmentDoctorsCharge.Text.Trim());

            Treatment treatment = new Treatment(treatmentcode, treatmenttype, treatmentdetails, doctorid, patientid, standardfee, doctorscharge);

            tdbo.deleteTreatmentInfo(treatment);
            MessageBox.Show("The dental treatment record & it's information has been removed.", "Delete Success!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            txtDentalTreatmentTreatmentCode.Text = ""; txtDentalTreatmentTreatmentDetails.Text = ""; txtDentalTreatmentDoctorID.Text = ""; txtDentalTreatmentPatientID.Text = ""; txtDentalTreatmentStandardFee.Text = ""; txtDentalTreatmentDoctorsCharge.Text = ""; lblDentalTreatmentDoctorName.Text = ""; lblDentalTreatmentPatientName.Text = ""; txtDentalTreatmentTreatmentType.SelectedItem = null;
        }
示例#5
0
        private void btnDentalTreatmentSearch_Click(object sender, EventArgs e)
        {
            try
            {
                string       treatmentcode = txtDentalTreatmentTreatmentCode.Text;
                TreatmentDBO tdbo          = new TreatmentDBO();
                Treatment    treatment     = tdbo.findTreatment(treatmentcode);

                txtDentalTreatmentTreatmentCode.Text    = treatment.getTreatmentCode();
                txtDentalTreatmentTreatmentType.Text    = treatment.getTreatmentType();
                txtDentalTreatmentTreatmentDetails.Text = treatment.getTreatmentDetails();
                txtDentalTreatmentDoctorID.Text         = treatment.getDoctorID();
                txtDentalTreatmentPatientID.Text        = treatment.getPatientID();
                txtDentalTreatmentStandardFee.Text      = treatment.getStandardFee().ToString();
                txtDentalTreatmentDoctorsCharge.Text    = treatment.getDoctorsCharge().ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Couldn't find any matching dental treatment records.", "Incorrect Entry", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#6
0
        private void btnDentalTreatmentSave_Click_1(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtDentalTreatmentDoctorID.Text))
            {
                MessageBox.Show("The Doctor's ID should be entered.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (string.IsNullOrWhiteSpace(txtDentalTreatmentPatientID.Text))
            {
                MessageBox.Show("The Patient's ID should be entered.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (string.IsNullOrWhiteSpace(txtDentalTreatmentTreatmentType.Text))
            {
                MessageBox.Show("The type of dental treatment should be selected.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                try
                {
                    TreatmentDBO tdbo             = new TreatmentDBO();
                    string       treatmentcode    = txtDentalTreatmentTreatmentCode.Text;
                    string       treatmenttype    = txtDentalTreatmentTreatmentType.Text;
                    string       treatmentdetails = txtDentalTreatmentTreatmentDetails.Text;
                    string       doctorid         = txtDentalTreatmentDoctorID.Text;
                    string       patientid        = txtDentalTreatmentPatientID.Text;
                    int          standardfee      = int.Parse(txtDentalTreatmentStandardFee.Text.Trim());
                    int          doctorscharge    = int.Parse(txtDentalTreatmentDoctorsCharge.Text.Trim());


                    Treatment treatment = new Treatment(treatmentcode, treatmenttype, treatmentdetails, doctorid, patientid, standardfee, doctorscharge);
                    tdbo.treatmentInfo(treatment);
                    MessageBox.Show("The patient's dental treatment information was added successfully.", "Save Success!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch (Exception ex2)
                {
                    MessageBox.Show("This Treatment Code has already been entered.", "Duplicate Entry", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
示例#7
0
        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);
                }
            }
        }