Exemple #1
0
 private void btnDues_Click(object sender, EventArgs e)
 {
     try
     {
         frmPatientDues fcf = new frmPatientDues(Int32.Parse(txtDoctorID.Text.Trim()), Int32.Parse(txtAppID.Text.Trim()), Int32.Parse(txtPatientID.Text.Trim())); //
         fcf.ShowDialog(this);
     }
     catch (Exception ex)
     {
         CommonLogger.Info(ex.ToString());
     }
 }
Exemple #2
0
        private void dgvApp_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            // MessageBox.Show(e.ColumnIndex.ToString());
            try
            {
                switch (dgvApp.Columns[e.ColumnIndex].Name)
                {
                case "ABtnDues":
                    try
                    {
                        frmPatientDues fcf = new frmPatientDues(0, Int32.Parse(dgvApp.Rows[e.RowIndex].Cells["AID"].Value.ToString()), Int32.Parse(dgvApp.Rows[e.RowIndex].Cells["APatID"].Value.ToString()));     //
                        fcf.ShowDialog(this);
                    }
                    catch (Exception ex)
                    {
                        CommonLogger.Info(ex.ToString());
                    }
                    break;

                case "ABtnBill":
                    if (dgvApp.Rows[e.RowIndex].Cells["AStatus"].Value.ToString() == "Completed" && Utils.DaysBetweenDates(dtpAppDate.Text, DateTime.Now.ToShortDateString()) >= 0)
                    {
                        ViewBill(Int32.Parse(dgvApp.Rows[e.RowIndex].Cells["AID"].Value.ToString()), Int32.Parse(dgvApp.Rows[e.RowIndex].Cells["APatID"].Value.ToString()));
                    }
                    else
                    {
                        MessageBox.Show("Bills can be generated/viewed for today's/past completed appointments only", "Information", MessageBoxButtons.OK);
                    }
                    break;

                case "ABtnDetails":
                    ViewDetails(Int32.Parse(dgvApp.Rows[e.RowIndex].Cells["AID"].Value.ToString()), Int32.Parse(dgvApp.Rows[e.RowIndex].Cells["APatID"].Value.ToString()));
                    break;

                case "ABtnDelete":
                    DeletePatient(Int32.Parse(dgvApp.Rows[e.RowIndex].Cells["AID"].Value.ToString()), Int32.Parse(dgvApp.Rows[e.RowIndex].Cells["APatID"].Value.ToString()), Int32.Parse(dgvApp.Rows[e.RowIndex].Cells["AStatusID"].Value.ToString()));
                    break;
                }
                getAppointmentList();
            }
            catch (Exception ex)
            {
                CommonLogger.Info(ex.ToString());
            }
        }