Example #1
0
    protected void RefreshGridView()
    {
        if (dbcon != null)
        {
            dbcon.Dispose();
        }


        dbcon = new TGDBEntities();
        dbcon.AppointmentTables.Where(item => item.PatientId.Equals(userID)).Load();

        UpcomingAppointmentsGridView.DataSource = dbcon.AppointmentTables.Local;
        UpcomingAppointmentsGridView.DataBind();
    }
    protected void RefreshGridView()
    {
        if (dbcon != null)
        {
            dbcon.Dispose();
        }
        TGDBEntities dbconD = new TGDBEntities();

        var docUser = (from x in dbconD.DoctorTables
                       where x.DoctorUserName == User.Identity.Name
                       select x).First();

        userID = docUser.DoctorId;

        TGDBEntities dbconA = new TGDBEntities();

        dbconA.AppointmentTables.Where(item => item.DoctorId.Equals(userID)).Load();

        UpcomingAppointmentsGridView.DataSource = dbconA.AppointmentTables.Local;
        UpcomingAppointmentsGridView.DataBind();
    }