コード例 #1
0
        // GET: /Students/
        public ActionResult Index()
        {
            try
            {
                dbTIREntities db = new dbTIREntities();
                SiteUser siteUser = ((SiteUser)Session["SiteUser"]);
                StudentService studentService = new StudentService(siteUser, db);
                SchoolService schoolService = new SchoolService(siteUser, db);
                ModelServices modelService = new ModelServices();
                string currentSchoolYear = schoolService.GetCurrentSchoolYear();
                ViewBag.DistrictDesc = siteUser.Districts[0].Name;
                int schoolYearId = modelService.SchoolYearId();
                ViewBag.SchoolId = modelService.DropDownDataSchool("", siteUser.EdsUserId, schoolYearId, true);
                ViewBag.AllowEdit = HelperService.AllowUiEdits(siteUser.RoleDesc, "STUDENT");
                //ViewBag.SchoolYear = HelperService.SchoolYearDescription(db);
                ViewBag.SchoolYearList = schoolService.DropDownDataSchoolYear(currentSchoolYear);
                ViewBag.AllowEdit = HelperService.AllowUiEdits(siteUser.RoleDesc, "STUDENT");
                ViewBag.SchoolYear = currentSchoolYear;

                return View(new SiteModels()
                {
                    Students = studentService.GetViewData(currentSchoolYear, "", "")
                });
            }
            catch (Exception ex)
            {
                Logging log = new Logging();
                log.LogException(ex);
                return View("GeneralError");
            }
        }
コード例 #2
0
        // GET: /Weighting/
        public ActionResult Index()
        {
            try
            {
                SiteUser su = ((SiteUser)Session["SiteUser"]);
                ModelServices modelServices = new ModelServices();
                int userAssignedDistrict = su.Districts[0].Id;
                int schoolYearId = modelServices.SchoolYearId();

                WeightingModel data = new WeightingModel();
                data.SchoolYear = modelServices.SchoolYearDescription();
                data.SummaryList = modelServices.GetWeightingSummary(userAssignedDistrict, schoolYearId);
                data.DistrictName = modelServices.GetDistrictName(userAssignedDistrict);

                data.DropDown = new DropDownData();
                data.DropDown.Year = new YearDropDown(modelServices.SchoolYearDropDownData());
                data.DropDown.Year.SelectedYear = schoolYearId;

                return View("Index", data);
            }
            catch (Exception ex)
            {
                Logging log = new Logging();
                log.LogException(ex);
                return View("GeneralError");
            }
        }
コード例 #3
0
 //
 // GET: /AssessmentClassScore/
 public ActionResult Index()
 {
     AssessmentClassScoreViewModel model = new AssessmentClassScoreViewModel();
     modelServices = new ModelServices();
     int schoolYearId = modelServices.SchoolYearId();
     model.SchoolYearId = Convert.ToString(schoolYearId);
     FillDropDowns(model, false);
     return View(model);
 }
コード例 #4
0
 public ActionResult Index()
 {
     try
     {
         db = new dbTIREntities();
         siteUser = ((SiteUser)Session["SiteUser"]);
         userService = new UserService(siteUser, db);
         schoolService = new SchoolService(siteUser, db);
         modelService = new ModelServices();
         int schoolYearId = modelService.SchoolYearId();
         string currentSchoolYear = schoolService.GetCurrentSchoolYear();
         ViewBag.SchoolYearList = schoolService.DropDownDataSchoolYear(currentSchoolYear);
         FillViewBagValues(siteUser.Districts[0].Name, string.Empty, siteUser.RoleDesc, schoolYearId);
         return View(userService.GetViewData(currentSchoolYear, "", ""));
     }
     catch (Exception ex)
     {
         Logging log = new Logging();
         log.LogException(ex);
         return View("GeneralError");
         //throw;
     }
 }
コード例 #5
0
        // GET: /User/Create
        public ActionResult Create()
        {
            try
            {
                db = new dbTIREntities();
                siteUser = ((SiteUser)Session["SiteUser"]);
                modelService = new ModelServices();
                schoolService = new SchoolService(siteUser, db);
                userService = new UserService(siteUser, db);

                int userAssignedDistrict = siteUser.Districts[0].Id;
                int schoolYearId = modelService.SchoolYearId();

                tblUserExt userExtended = new tblUserExt();
                userExtended.SchoolYearId = schoolYearId;
                userExtended.Schools = userService.GetSchoolWithCheckBoxes(userExtended);
                ViewBag.RoleId = new SelectList(modelService.GetRolesForRole((int)(siteUser.Role)), "RoleId", "RoleDesc");
                FillViewBagValues(siteUser.Districts[0].Name, string.Empty, siteUser.RoleDesc, schoolYearId);
                return View(userExtended);
            }
            catch (Exception ex)
            {
                Logging log = new Logging();
                log.LogException(ex);
                return View("GeneralError");
            }
        }
コード例 #6
0
        public ActionResult SummaryReportById(int teacherId, bool viewMeetExceedSummary = true)
        {
            try
            {
                SetNavigationLinksUrl();
                SetViewBag(viewMeetExceedSummary);
                ViewBag.SummaryLink = "SummaryReportById";
                ViewBag.TeacherFilter = teacherId;
                bool unAuthorizedRequest = false;
                SiteUser su = ((SiteUser)Session["SiteUser"]);
                ModelServices modelServices = new ModelServices();
                StudentService studentService = new StudentService(su, entities);
                int defaultDistrict = su.Districts[0].Id;
                int schoolYearId = modelServices.SchoolYearId();
                int[] userSchools = modelServices.getSchoolsByUserId(su.EdsUserId).ToArray();

                var dropdownTeachers = modelServices.TeacherDropDownDataBySchoolAndYear(userSchools, schoolYearId, defaultDistrict);
                unAuthorizedRequest = dropdownTeachers.Where(x => x.Id == teacherId).Count() == 0 ? true : false;

                if (unAuthorizedRequest)
                {
                    return RedirectToAction("AccessDenied", "Error");
                }

                TIRSummaryModel data = new TIRSummaryModel();
                data.SchoolYear = modelServices.SchoolYearDescription();
                data.DropDown = new DropDownData();
                data.DropDown.Year = new YearDropDown(modelServices.SchoolYearDropDownData());
                data.DropDown.Year.SelectedYear = schoolYearId;
                data.DropDown.District = new DistrictDropDown(modelServices.DistrictDropDownDataByUser(su.EdsUserId));
                data.DropDown.Teacher = new TeacherDropDown(dropdownTeachers);
                data.DropDown.Teacher.SelectedTeacher = teacherId;
                data.DropDown.Race = new RaceDropDown(modelServices.DropDownDataForRace(), true);
                data.DropDown.Gender = new GenderDropDown(modelServices.DropDownDataForGender(), true);
                data.DropDown.SchoolClass = new ClassDropDown(modelServices.GetClassesByTeacher(schoolYearId, new[] { teacherId }));

                var filterParameter = new FilterParameter
                {
                    ClassId = classDefaultValue,
                    Teacher = teacherId,
                    School = userSchools.First(),
                    Year = schoolYearId,
                    SchoolYear = data.SchoolYear
                };
                data.SummaryList = modelServices.GetSummaryReport(filterParameter);
                data.DropDown.School = new SchoolDropDown(modelServices.GetSchoolDropDownData(su.EdsUserId, schoolYearId));
                var reportFilterViewModel = ReportsFilterHelper.PopulateReportFilterViewModel(filterParameter, modelServices, su);
                ViewBag.ReportFilters = reportFilterViewModel;
                return View("SummaryReport", data);
            }
            catch (Exception ex)
            {
                Logging log = new Logging();
                log.LogException(ex);
                return View("GeneralError");
            }
        }
コード例 #7
0
        public ActionResult SummaryReport(bool viewMeetExceedSummary = true)
        {
            try
            {
                SetNavigationLinksUrl();
                ViewBag.SummaryLink = "SummaryReport";

                SetViewBag(viewMeetExceedSummary);
                SiteUser su = ((SiteUser)Session["SiteUser"]);
                ModelServices modelServices = new ModelServices();
                StudentService studentService = new StudentService(su, entities);

                int defaultDistrict = su.Districts[0].Id;
                int schoolYearId = modelServices.SchoolYearId();
                int[] userSchools = modelServices.getSchoolsByUserId(su.EdsUserId).ToArray();

               

                TIRSummaryModel data = new TIRSummaryModel();
                data.SchoolYear = modelServices.SchoolYearDescription();
                data.DropDown = new DropDownData();
                data.DropDown.Year = new YearDropDown(modelServices.SchoolYearDropDownData());
                data.DropDown.Year.SelectedYear = schoolYearId;
                data.DropDown.District = new DistrictDropDown(modelServices.DistrictDropDownDataByUser(su.EdsUserId));

                data.DropDown.Race = new RaceDropDown(modelServices.DropDownDataForRace(), true);
                data.DropDown.Race.SelectedRace = -1;
                data.DropDown.Gender = new GenderDropDown(modelServices.DropDownDataForGender(), true);
                data.DropDown.Gender.SelectedGender = -1;

                data.DropDown.School = new SchoolDropDown(modelServices.GetSchoolDropDownData(su.EdsUserId, schoolYearId));
                if (su.isTeacher)
                {
                    data.DropDown.Teacher = new TeacherDropDown(
                        new List<DropDownIdName>() { new DropDownIdName() { Id = su.EdsUserId, Name = su.UserFullName } });
                    data.DropDown.SchoolClass = new ClassDropDown(modelServices.GetClassesByTeacher(schoolYearId, new[] { su.EdsUserId }));
                }
                else // data administrator and eds administrator
                {
                    int[] schoolsTeacher = modelServices.getTeachersBySchoolsId(userSchools).ToArray();
                    data.DropDown.Teacher = new TeacherDropDown(modelServices.TeacherDropDownDataBySchoolAndYear(userSchools, schoolYearId, defaultDistrict));
                    data.DropDown.SchoolClass = new ClassDropDown(modelServices.GetClassesByTeacher(schoolYearId, schoolsTeacher));
                }

                var filterParameter = new FilterParameter
                {
                    ClassId = classDefaultValue,
                    Teacher = su.EdsUserId,
                    School = userSchools.First(),
                    Year = schoolYearId,
                    SchoolYear = data.SchoolYear
                };
                data.SummaryList = modelServices.GetSummaryReport(filterParameter);
                var reportFilterViewModel = ReportsFilterHelper.PopulateReportFilterViewModel(filterParameter, modelServices, su);
                ViewBag.ReportFilters = reportFilterViewModel;
                return View(data);
            }
            catch (Exception ex)
            {
                Logging log = new Logging();
                log.LogException(ex);
                return View("GeneralError");
            }
        }
コード例 #8
0
        public ActionResult Create(int schoolYear)
        {
            try
            {
                dbTIREntities db = new dbTIREntities();
                StudentExt studentExt = new StudentExt();
                ModelServices modelService = new ModelServices();
                studentExt.SchoolYear = schoolYear;
                PopulateViewData(studentExt);
                studentExt.SchoolYearDesc = HelperService.SchoolYearDescription(db);
                studentExt.SchoolYearId = modelService.SchoolYearId();
                return View(studentExt);

            }
            catch (Exception ex)
            {
                Logging log = new Logging();
                log.LogException(ex);
                return View("GeneralError");
            }
        }
コード例 #9
0
 // GET: /Classes/Create
 public ActionResult Create()
 {
     try
     {
         SiteUser siteUser = (SiteUser)Session["SiteUser"];
         var db = new dbTIREntities();
         SchoolService schoolService = new SchoolService(siteUser, db);
         ModelServices modelService = new ModelServices();
         int defaultDistrict = siteUser.Districts[0].Id;
         ViewBag.DistrictDesc = siteUser.Districts[0].Name;
         int schoolYearId = modelService.SchoolYearId();
         ViewBag.SchoolId = modelService.DropDownDataSchool("", siteUser.EdsUserId, schoolYearId, false);
         ViewBag.SchoolYearId = modelService.GetUserSchoolYear(siteUser.EdsUserId, defaultDistrict, schoolYearId);
         ViewBag.SubjectId = new SelectList(db.tblSubjects.OrderBy(x => x.SubjectDesc), "SubjectId", "SubjectDesc");
         return View();
     }
     catch (Exception ex)
     {
         Logging log = new Logging();
         log.LogException(ex);
         return View("GeneralError");
     }
 }