Ejemplo n.º 1
0
        public async Task <ActionResult> CreateCategory()
        {
            var categorySelectListItems = (await _eClassAppService.GetCategoryDDLItems()).Items
                                          .Select(p => p.ToSelectListItem())
                                          .ToList();

            categorySelectListItems.Insert(0, new SelectListItem {
                Value = string.Empty, Text = L("DEFAULTSELECT"), Selected = true
            });

            var programSelectListItems = (await _eClassAppService.GeProgramDDLItems()).Items
                                         .Select(p => p.ToSelectListItem())
                                         .ToList();

            programSelectListItems.Insert(0, new SelectListItem {
                Value = string.Empty, Text = L("DEFAULTSELECT"), Selected = true
            });

            return(View("CreateCategory", new CreateCategoryViewModel(categorySelectListItems, programSelectListItems)));
        }
Ejemplo n.º 2
0
        // GET: /<controller>/
        public async Task <ActionResult> Index()
        {
            GetCategoryListInput input = new GetCategoryListInput();

            input.ProgramListId = 0;

            var output = await _eClassAppService.GetCategoryListByProgramId(input);

            //var program = _eClassAppService.GetProgramById(input.ProgramListId);

            //if (program != null)
            //{
            //    ViewBag.UniqueId = program.UniqueId;
            //    ViewBag.Name = program.Name;
            //    ViewBag.Description = program.Description;
            //}

            //List<CBTContentDto> cbtContentList = new List<CBTContentDto>();

            //foreach (var cat in output.Items)
            //{
            //    var contentByCategoryId = await _eClassAppService.GetCBTContentByCategoryId(cat.Id);
            //    cbtContentList.AddRange(contentByCategoryId);
            //}
            //cbtContentList = cbtContentList.ToList();

            var programSelectListItems = (await _eClassAppService.GeProgramDDLItems()).Items
                                         .Select(p => p.ToSelectListItem())
                                         .ToList();

            programSelectListItems.Insert(0, new SelectListItem {
                Value = string.Empty, Text = L("DEFAULTSELECT"), Selected = true
            });

            CategoryListViewModel clVM = new CategoryListViewModel(output.Items);

            //clVM.CBTContentLists = cbtContentList;
            clVM.ProgramList = programSelectListItems;

            return(View("PreviewCBT", clVM));
        }