private void dgvList_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         switch (dgvList.Columns[e.ColumnIndex].Name)
         {
         case "bBtnBill":
             if (dgvList.Rows[e.RowIndex].Cells["bTypeID"].Value.ToString() == "1")
             {
                 frmConsultationBill frm = new frmConsultationBill(Int32.Parse(dgvList.Rows[e.RowIndex].Cells["bID"].Value.ToString()));
                 frm.ShowDialog();
             }
             else if (dgvList.Rows[e.RowIndex].Cells["bTypeID"].Value.ToString() == "2")
             {
                 frmProceduresBill frm = new frmProceduresBill(Int32.Parse(dgvList.Rows[e.RowIndex].Cells["bID"].Value.ToString()));
                 frm.ShowDialog();
             }
             else if (dgvList.Rows[e.RowIndex].Cells["bTypeID"].Value.ToString() == "3")
             {
                 frmOneTimeBill frm = new frmOneTimeBill(Int32.Parse(dgvList.Rows[e.RowIndex].Cells["bID"].Value.ToString()));
                 frm.ShowDialog();
             }
             break;
         }
     }
     catch (Exception ex)
     {
         CommonLogger.Info(ex.ToString());
     }
 }
 private void ViewBill(int app_id, int pat_id)
 {
     try
     {
         frmOneTimeBill frm = new frmOneTimeBill(app_id, pat_id);
         frm.ShowDialog();
     }
     catch (Exception ex)
     {
         CommonLogger.Info(ex.ToString());
     }
 }
        private void btnGenerateBill_Click(object sender, EventArgs e)
        {
            try
            {
                switch (cmbBillType.SelectedValue.ToString())
                {
                case "0":
                    MessageBox.Show("Please choose a bill type!");
                    break;

                case "1":
                    frmConsultationBill frm = new frmConsultationBill(appointment_id, patient_id);
                    frm.ShowDialog();
                    ListBills();
                    break;

                case "2":
                    int count = 0;
                    using (ConsultationDetails cdet = new ConsultationDetails())
                    {
                        DataTable dtProcedures = cdet.getProceduresFromApptID(appointment_id);
                        count = dtProcedures.Rows.Count;
                    }
                    if (count > 0)
                    {
                        frmProceduresBill frm1 = new frmProceduresBill(appointment_id, patient_id);
                        frm1.ShowDialog();
                        ListBills();
                    }
                    else
                    {
                        MessageBox.Show("Cannot Generate Bill as Procedures have not been added to this appointment!");
                    }
                    break;

                case "3":
                    frmOneTimeBill frm2 = new frmOneTimeBill(appointment_id, patient_id);
                    frm2.ShowDialog();
                    ListBills();
                    break;
                }
            }
            catch (Exception ex)
            {
                CommonLogger.Info(ex.ToString());
            }
        }
Exemple #4
0
        private void ViewBill(int app_id, int pat_id)
        {
            try
            {
                //check whether same day another bill generated. if, so block it

                /*
                 * int ret = app.GetBillLockStatus(app_id);
                 * if (ret > 0)
                 * {
                 *  MessageBox.Show("Bills can be generated/viewed only for latest appointments for a patient.", "Information", MessageBoxButtons.OK);
                 *  getAppointmentList(0);
                 *
                 * }
                 * else
                 * {
                 *
                 * }
                 */
                frmOneTimeBill frm = new frmOneTimeBill(app_id, pat_id);
                frm.ShowDialog();

                /*if (Application.OpenForms.OfType<frmAppointmentBill>().Count() == 1)
                 *  Application.OpenForms.OfType<frmAppointmentBill>().First().Close();
                 * frmAppointmentBill frm = new frmAppointmentBill(app_id, pat_id);
                 *              frm.MdiParent = this.ParentForm;
                 * frm.Show();*/
                /*
                 * if (this.dtpAppDate.Text != DateTime.Now.ToShortDateString())
                 * {
                 *  MessageBox.Show("Sorry! Only today's bill can be generated.","Information",MessageBoxButtons.OK);
                 * }
                 * else
                 * {
                 */


                //}
            }
            catch (Exception ex)
            {
                CommonLogger.Info(ex.ToString());
            }
        }
Exemple #5
0
 private void btnGenBill_Click(object sender, EventArgs e)
 {
     try
     {
         DataTable dt     = objCD.getRecordFromID(Convert.ToInt32(txtAppID.Text));
         string    status = dt.Rows[0]["status"].ToString();
         if (status == "2" && Utils.DaysBetweenDates(txtMeetDate.Text, DateTime.Now.ToShortDateString()) >= 0)
         {
             frmOneTimeBill frm = new frmOneTimeBill(Int32.Parse(txtAppID.Text.ToString()), Int32.Parse(txtPatientID.Text));
             frm.ShowDialog();
         }
         else
         {
             MessageBox.Show("Bills can be generated/viewed for today's/past completed appointments only. \n Please change the status to completed before generating the bill.");
         }
     }
     catch (Exception ex)
     {
         CommonLogger.Info(ex.ToString());
     }
 }