コード例 #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));
        }
コード例 #2
0
        public ActionResult DetailView(detailsearchmodel data)
        {
            LessonPlanModel model  = new LessonPlanModel();
            var             a      = data.from.Replace("-", "/");
            DateTime        from   = Convert.ToDateTime(a);
            DateTime        to     = from.AddDays(4);
            var             result = mapping.ToList(unitOfWork.LessonsPlanMasterRepository.Get((x => x.IsActive == false && x.ClassId == data.clas && x.SubjectId == data.subject && x.CreatedFor >= from && x.CreatedFor <= to)));

            model.LessonsPlanMasterModelList = result;
            ViewBag.count = model.LessonsPlanMasterModelList.Count;
            return(PartialView(model));
        }
コード例 #3
0
 // GET: Category
 public ActionResult Index()
 {
     model.CategoryList = mapping.ToList(unitOfWork.LessonPlanCategoryRepository.Get(x => x.HasParent == false));
     return(View(model));
 }