Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
 public JsonResult AddNewCSPGoalCatalog(int cspGoalCatalogId, int?parentId, int CSPId, string dateInitiated, string rate1, string rate2, string rate3, string textGoal)
 {
     if (cspGoalCatalogId == 0)
     {
         CSPGoalCatalog.AddNew(parentId > -1 ? parentId : null, CSPId, dateInitiated, rate1, rate2, rate3, textGoal, ApplicationHelper.LoggedUserId);
     }
     else
     {
         CSPGoalCatalog.Update(cspGoalCatalogId, dateInitiated, rate1, rate2, rate3, textGoal);
     }
     return(Json(true, JsonRequestBehavior.AllowGet));
 }
Ejemplo n.º 3
0
        public JsonResult GetCspGoalCatalog(int id)
        {
            CSPGoalCatalog _item   = CSPGoalCatalog.GetById(id);
            CSPGoalCatalog _retVal = new CSPGoalCatalog()
            {
                Id = _item.Id,
                ParentCSPGoalCatalogId = _item.ParentCSPGoalCatalogId,
                TextGoal      = _item.TextGoal,
                DateInitiated = _item.DateInitiated,
                Rate1         = _item.Rate1,
                Rate2         = _item.Rate2,
                Rate3         = _item.Rate3
            };

            return(Json(_retVal, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 4
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));
        }
Ejemplo n.º 5
0
        public ActionResult MoveOrderDown(int id)
        {
            CSP _item = CSPGoalCatalog.MoveDown(id);

            return(RedirectToAction("Notes", new { id = _item.Id }));
        }
Ejemplo n.º 6
0
 public JsonResult RemoveCSPGoalCatalog(int id)
 {
     CSPGoalCatalog.SoftDelete(id);
     return(Json(true, JsonRequestBehavior.AllowGet));
 }