Beispiel #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));
        }
Beispiel #2
0
        public ActionResult LoadSubCategories(int id)
        {
            DigitalResourceModel model = new DigitalResourceModel();
            var data = LoadcateGoriesByParent(id).Select(x => new CategoryGeneralModel {
                Id = x.Id, Name = x.Name, parentId = x.ParentId, TotalSubList = count(x.Id)
            }).ToList();

            if (data.Count() > 0)
            {
                model.CategoryGeneralModelList = data;
            }
            return(PartialView(model));
        }
Beispiel #3
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));
        }
Beispiel #4
0
        public ActionResult DetailPage(int id)
        {
            Session[WebUtil.SubParentId] = id;
            int category = (int)Session[WebUtil.SubParentId];

            Session.Timeout = 240;
            var detail = dmapping.ToList(unitOfWork.DigitalResourceMasterRepository.Get(x => x.CategoryId == id).ToList());
            DigitalResourceModel model = new DigitalResourceModel();

            model.MasterModelList = detail;
            CategoryModel md = new CategoryModel();
            var           db = unitOfWork.LessonPlanCategoryRepository.GetByID(id);

            md.Id               = id;
            md.ParentId         = (int)db.ParentId;
            model.CategoryModel = md;
            return(View(model));
        }