コード例 #1
0
        public ActionResult UpdateGrid(int hiddenYearFilter)
        {
            try
            {
                SiteUser su = ((SiteUser)Session["SiteUser"]);
                ModelServices modelServices = new ModelServices();

                WeightingModel data = new WeightingModel();
                int userAssignedDistrict = su.Districts[0].Id;
                data.DistrictName = modelServices.GetDistrictName(userAssignedDistrict);
                data.SchoolYear = modelServices.SchoolYearDescriptionByYearId(hiddenYearFilter);

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

                data.SummaryList = modelServices.GetWeightingSummary(userAssignedDistrict, hiddenYearFilter); ;

                return View("Index", data);
            }
            catch (Exception ex)
            {
                Logging log = new Logging();
                log.LogException(ex);
                return View("GeneralError");
            }
        }
コード例 #2
0
        public ActionResult Index(int studentId, string cameFromTitle, bool showRawScale = false, int summaryCount = 0, int detailCount = 0)
        {
            try
            {
                base.SetNavigationLinksUrl();

                ModelServices modelServices = new ModelServices();
                StudentHistoryModel data = new StudentHistoryModel();

                ViewBag.StudentId = studentId;
                ViewBag.ShowRawScale = showRawScale;
                ViewBag.Count = detailCount + 1;
                ViewBag.SummaryCount = summaryCount + 1;
                SiteUser su = ((SiteUser)Session["SiteUser"]);                
                data.History = modelServices.GetStudentHistoryReport(studentId, showRawScale, su.Districts.First().Id);

                tblStudent tempStudent = modelServices.GetStudentById(studentId);
                data.CameFromTitle = cameFromTitle;
                data.Student = tempStudent.FirstName + " " + tempStudent.LastName;
                data.District = modelServices.GetDistrictName(int.Parse(tempStudent.DistrictId.ToString()));
                data.School = modelServices.GetSchoolNameByStudentId(studentId);
                return View("Index", data);
            }
            catch (Exception ex)
            {
                Logging log = new Logging();
                log.LogException(ex);
                return View("GeneralError");
            }
        }