예제 #1
0
        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            var context = new dataContext();
            IEnumerable <category> list = context.Set <category>();

            return(View(list.ToList()));
        }
예제 #2
0
        public PartialViewResult Menu()
        {
            var context = new dataContext();
            //List<RoleValue> roleValues = (List<RoleValue>)Session["MagentyRoleValues"];
            //List<RoleValue> menuList = new List<RoleValue>();
            //menuList = roleValues.Where(x => x.MenuOrAction == "M" && x.IsPermission == true).ToList();
            //return PartialView("_Menu", menuList);

            List <category> categoryList = new List <category>();

            categoryList = context.Set <category>().ToList();

            //List<List<category>> orderedList = new List<List<category>>();

            //foreach (var item in categoryList)
            //{
            //    List<category> itemCat = new List<category>();

            //    if (item.topCategoryId == 0)
            //    {
            //        itemCat.Add(item);
            //        foreach (var itemList in categoryList)
            //        {
            //            if (item.id == itemList.topCategoryId)
            //            {
            //                itemCat.Add(itemList);
            //            }
            //        }
            //    }



            //    orderedList.Add(itemCat);
            //}



            return(PartialView("_Menu", categoryList));
        }
예제 #3
0
 public async Task <IEnumerable <Student> > GetAllAsync()
 {
     return(await _courseprDbContext.Set <Student>().ToListAsync());
 }
예제 #4
0
 public async Task <IEnumerable <Course> > GetAllAsync()
 {
     return(await _courseprDbContext.Set <Course>().Include(p => p.courseTime).ToListAsync());
 }