Пример #1
0
        public ActionResult Notes(int id)
        {
            string rate1 = string.Empty;
            string rate2 = string.Empty;
            string rate3 = string.Empty;
            CSP    _item = CSP.GetById(id);

            CSP.AdjustOrder(id);
            List <string> dateinitVal = new List <string>();
            int           year        = int.Parse(DateTime.Now.Year.ToString().Replace("20", ""));
            int           orgYear     = year;
            int           month       = 7;

            for (int i = 0; i < 12; i++)
            {
                dateinitVal.Add(month + "/" + year);
                if (month == 11 && year == orgYear)
                {
                    rate1 = month + "/" + year;
                }
                if (month == 2)
                {
                    rate2 = month + "/" + year;
                }
                if (month == 6)
                {
                    rate3 = month + "/" + year;
                }
                month++;
                if (month > 12)
                {
                    month = 1;
                    year++;
                }
            }
            ViewBag.rate1            = rate1;
            ViewBag.rate2            = rate2;
            ViewBag.rate3            = rate3;
            ViewBag.AllDateInitiated = new SelectList(dateinitVal);
            List <Rating> allrates = Rating.GetAll(_item.Student.SchoolId);

            allrates.Insert(0, new Rating()
            {
                Description = ""
            });
            ViewBag.AllRates = new SelectList(allrates, "RateValue", "Description");
            List <CSPGoalCatalog> allGoals = CSPGoalCatalog.GetAll(id).Where(a => a.ParentCSPGoalCatalogId == null).ToList();

            allGoals.Insert(0, new CSPGoalCatalog()
            {
                Id = -1, TextGoal = "NONE"
            });
            ViewBag.allGoals = new SelectList(allGoals, "Id", "TextGoal");
            return(View(_item));
        }
Пример #2
0
        public ActionResult CSPGoaCatalog_Read([DataSourceRequest] DataSourceRequest request, int cspId)
        {
            IQueryable <CSPGoalCatalog> items  = CSPGoalCatalog.GetAll(cspId).AsQueryable();
            DataSourceResult            result = items.ToDataSourceResult(request, _item => new
            {
                Id                = _item.Id,
                ParentName        = _item.ParentName,
                TextGoal          = _item.TextGoal,
                DateInitiated     = _item.DateInitiated,
                Rate1             = _item.Rate1,
                Rate2             = _item.Rate2,
                Rate3             = _item.Rate3,
                CreatedOn         = _item.CreatedOn,
                CreatedByUserName = _item.CreatedByUserName
            });

            return(Json(result));
        }