Ejemplo n.º 1
0
        // GET: Gallery
        public ActionResult Index(int id)
        {
            Session[WebUtil.ParentId]   = null;
            Session[WebUtil.Controller] = null;
            var controler = unitOfWork.LessonPlanCategoryRepository.GetByID(id).ControllerName;

            Session[WebUtil.Controller] = controler;
            var list    = mapping.ToList(unitOfWork.LessonPlanCategoryRepository.Get(x => x.ParentId == id));
            var general = new DigitalResourceModel();
            List <CategoryGeneralModel> generalmodellist = new List <CategoryGeneralModel>();

            foreach (var i in list)
            {
                CategoryGeneralModel obj = new CategoryGeneralModel();
                var getpbj = unitOfWork.LessonPlanCategoryRepository.GetByID(i.Id);
                obj.Id           = getpbj.Id;
                obj.Name         = getpbj.Name;
                obj.TotalSubList = unitOfWork.DigitalResourceMasterRepository.Get(x => x.CategoryId == i.Id).Count();
                generalmodellist.Add(obj);
            }
            ViewBag.category = mapping.ToObj(unitOfWork.LessonPlanCategoryRepository.GetByID(id));
            general.CategoryGeneralModelList = generalmodellist;
            ViewBag.id = id;
            CategoryGeneralModel controller = new CategoryGeneralModel();
            CategoryModel        md         = new CategoryModel();

            md.Id                     = id;
            md.controller             = (string)Session[WebUtil.Controller];
            general.CategoryModel     = md;
            Session[WebUtil.ParentId] = id;
            return(View(general));
        }
Ejemplo n.º 2
0
        public ActionResult DisplayContent(int id)
        {
            var list    = mapping.ToList(unitOfWork.LessonPlanCategoryRepository.Get(x => x.ParentId == id));
            var general = new DigitalResourceModel();
            List <CategoryGeneralModel> generalmodellist = new List <CategoryGeneralModel>();

            foreach (var i in list)
            {
                CategoryGeneralModel obj = new CategoryGeneralModel();
                obj.Name         = unitOfWork.LessonPlanCategoryRepository.GetByID(i.Id).Name;
                obj.TotalSubList = unitOfWork.DigitalResourceMasterRepository.Get(x => x.CategoryId == i.Id).Count();
                generalmodellist.Add(obj);
            }
            ViewBag.category = mapping.ToObj(unitOfWork.LessonPlanCategoryRepository.GetByID(id));
            general.CategoryGeneralModelList = generalmodellist;
            ViewBag.id = id;
            return(PartialView(general));
        }