public ActionResult Index()
        {
            ViewBag.Caidathethong = "active";
            var model = new SettingModel();

            model.Box1               = _service.GetByName("Box1")?.configBody ?? null;
            model.Box2               = _service.GetByName("Box2")?.configBody ?? null;
            model.Box3               = _service.GetByName("Box3")?.configBody ?? null;
            model.GioiThieuTacPham   = _service.GetByName("GioiThieuTacPham")?.configBody ?? null;
            model.Footer             = _service.GetByName("Footer")?.configBody ?? null;
            model.MainMenu           = _service.GetByName("MainMenu")?.configBody ?? null;
            model.RightMenu          = _service.GetByName("RightMenu")?.configBody ?? null;
            model.RightMenu2         = _service.GetByName("RightMenu2")?.configBody ?? null;
            model.RightMenu3         = _service.GetByName("RightMenu3")?.configBody ?? null;
            model.RightMenu4         = _service.GetByName("RightMenu4")?.configBody ?? null;
            model.LienKetWebsite     = _service.GetByName("LienKetWebsite")?.configBody ?? null;
            model.Banner             = _service.GetByName("Banner")?.configBody ?? null;
            model.BoxRight3          = _service.GetByName("BoxRight3")?.configBody ?? null;
            model.BoxRight4          = _service.GetByName("BoxRight4")?.configBody ?? null;
            ViewBag.Box1             = _toolAdmin.CategorySelectList(null, null, 1);
            ViewBag.Box2             = _toolAdmin.CategorySelectList(null, null, 1);
            ViewBag.Box3             = _toolAdmin.CategorySelectList(null, null, 1);
            ViewBag.GioiThieuTacPham = _toolAdmin.SlideDropdown(_sildeService);
            ViewBag.BoxRight3        = _toolAdmin.SlideDropdown(_sildeService);
            ViewBag.MainMenu         = _toolAdmin.MenuDropdown(_menuService, 1);
            ViewBag.RightMenu        = _toolAdmin.MenuDropdown(_menuService, 1);
            ViewBag.RightMenu2       = _toolAdmin.MenuDropdown(_menuService, 1);
            ViewBag.RightMenu3       = _toolAdmin.MenuDropdown(_menuService, 1);
            ViewBag.RightMenu4       = _toolAdmin.MenuDropdown(_menuService, 1);
            ViewBag.LienKetWebsite   = _toolAdmin.MenuDropdown(_menuService, 1);
            return(View(model));
        }
예제 #2
0
 public ActionResult menuHasSub(string stClass)
 {
     languagecode = HttpContext.Request.Cookies["languagecode"];
     if (languagecode != null && languagecode.Value == "en")
     {
         int?id = null;
         try { id = Convert.ToInt16(_configService.GetByName("MainMenuen").configBody); } catch { id = null; }
         if (id.HasValue)
         {
             IOrderedEnumerable <Menu> result = _menuService.GetAll().Where(x => x.parentId == id && x.isTrash == false && x.languageId == 2).OrderBy(x => x.sortOrder);
             ViewBag.stclass = stClass;
             return(PartialView(result));
         }
         else
         {
             ViewBag.stclass = stClass;
             return(PartialView(null));
         }
     }
     else
     {
         int?id = null;
         try { id = Convert.ToInt16(_configService.GetByName("MainMenu").configBody); } catch { id = null; }
         if (id.HasValue)
         {
             IOrderedEnumerable <Menu> result = _menuService.GetAll().Where(x => x.parentId == id && x.isTrash == false && x.languageId == 1).OrderBy(x => x.sortOrder);
             ViewBag.stclass = stClass;
             return(PartialView(result));
         }
         else
         {
             ViewBag.stclass = stClass;
             return(PartialView(null));
         }
     }
 }