Exemplo n.º 1
0
        public List <SelectListItem> GetSectionList(string DeptList, int Sem)
        {
            List <SelectListItem>      Section = new List <SelectListItem>();
            List <spGetSection_Result> l       = db.spGetSection(DeptList.Trim(), Sem).ToList();

            foreach (var s in l)
            {
                Section.Add(new SelectListItem {
                    Text = s.ID.ToString().Trim(), Value = s.Value.ToString().Trim()
                });
            }
            return(Section);
        }
Exemplo n.º 2
0
        public ActionResult SectionList(string Sem)
        {
            var        db     = new RNSITEntities();
            string     DeptId = ((string)TempData.Peek("Department")).ToUpper();
            IQueryable Sec    = db.spGetSection(DeptId, int.Parse(Sem)).AsQueryable();

            if (HttpContext.Request.IsAjaxRequest())
            {
                return(Json(new SelectList(Sec, "ID", "Value"), JsonRequestBehavior.AllowGet));
            }

            return(View(Sec));
        }