// 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)); }
public ActionResult Editdetail(int id) { var data = mapping.ToObj(unitOfWork.LessonsPlanMasterRepository.GetByID(id)); // data.URL = WebUtil.BasePath + data.Category + "/" + data.Clas + "_" + data.Subject + "/" + data.URL+data.FileExtnsion; ViewBag.count = data.LessonPlanDetailList.Count - 1; return(View(data)); }
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)); }