public void LoadGradeSections() { String message = String.Empty; GradeSectionServiceClient gService = new GradeSectionServiceClient(); gradeSectionList = new List<GradeSection>(gService.GetAllGradeSections()); try { if (GlobalClass.userTypeCode == "admin" || GlobalClass.user.UserType == "reg") { gvGradeSection.DataSource = gradeSectionList; } else if (GlobalClass.user.UserType == "teach") { var advisoryClass= gradeSectionList.FindAll(item => item.HomeRoomTeacherId == teacher.TeacherId); gvGradeSection.DataSource = advisoryClass; } gvGradeSection.Refresh(); } catch (Exception ex) { message = "Error Loading Teachers Load"; MessageBox.Show(ex.ToString()); } }
public void LoadGradeSections() { GradeSectionServiceClient gService = new GradeSectionServiceClient(); gradeSectionList = new List<GradeSection>(gService.GetAllGradeSections()); gvGradeSection.DataSource = gradeSectionList; }