protected void GridPatientCheckUp_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     if (Session["Doctor"] != null)
     {
         GridTodayAppointmntTODoctors.Visible   = true;
         GridTodayAppointmntTOAdmin.Visible     = false;
         GridTodayAppointmntTODoctors.PageIndex = e.NewPageIndex;
         getTodayAppointmentDetailsDoctorsWise();
         GridTodayAppointmntTODoctors.DataBind();
     }
     else if (Session["Receptionist"] != null)
     {
         GridTodayAppointmntTODoctors.Visible = false;
         GridTodayAppointmntTOAdmin.Visible   = true;
         GridTodayAppointmntTOAdmin.PageIndex = e.NewPageIndex;
         getTodayAppointmentDetailsToAdmin();
         GridTodayAppointmntTOAdmin.DataBind();
     }
 }
    protected void getTodayAppointmentDetailsDoctorsWise()
    {
        DateTime jdt       = Convert.ToDateTime(DateTime.Now.ToString());
        string   todaydate = String.Format("{0:yyyy-MM-dd}", jdt);

        try
        {
            int doctorId = Convert.ToInt32(Session["DoctorId"].ToString());
            ds = new DataSet();
            ds = appoint.GetAppointmentDetailsByTodayDateDoctorwise(Convert.ToDateTime(todaydate), doctorId);
            GridTodayAppointmntTODoctors.Visible    = true;
            GridTodayAppointmntTOAdmin.Visible      = false;
            GridTodayAppointmntTODoctors.DataSource = ds;
            GridTodayAppointmntTODoctors.DataBind();
        }
        catch (SqlException ex)
        {
            ShowMessageBox("Remote Acess Not Available");
        }
    }