Exemple #1
0
        public PartialViewResult MenuFooter(int ctrId, string url)
        {
            var model = new ModelMenusItem {
                CtrId = ctrId
            };

            if (Request["doAction"] == "setting")
            {
                model.ListMenuGroupsItem = _bl.GetMenusGroup();
                var key = _sysbl.GetKey(ctrId);
                model.PageId = key != null?int.Parse(key.Value) : 0;

                return(PartialView(model));
            }
            else
            {
                var urlpath = Request.Path.Split('/');
                model.CtrUrl = url;
                var key = _sysbl.GetKey(ctrId);
                var val = key != null?int.Parse(key.Value) : 1;

                model.ListItem = _bl.GetListMenus(val);
                model.Url      = urlpath.Length > 1 ? urlpath[1] : urlpath[0];

                return(PartialView(model));
            }
        }
Exemple #2
0
        public PartialViewResult MenuNews(int ctrId, string url, string slug = "Index")
        {
            var model = new ModelMenusItem {
                CtrId = ctrId
            };

            if (Request["doAction"] == "setting")
            {
                model.ListItem = _bl.GetListMenusById(1);
                var key = _sysbl.GetKey(ctrId);
                model.PageId = key != null?int.Parse(key.Value) : 0;

                return(PartialView(model));
            }
            else
            {
                model.CtrUrl = url;
                var key = _sysbl.GetKey(ctrId);
                var val = key != null?int.Parse(key.Value) : 0;

                model.ListItem     = _bl.GetListMenusById(val);
                model.CategoryItem = _bl.CategoryItem(val);
                return(PartialView(model));
            }
        }
Exemple #3
0
        public PartialViewResult MainMenu(int ctrId, string url, int cateId = 0, string slug = "Index")
        {
            var model = new ModelMenusItem {
                CtrId = ctrId
            };

            if (Request["doAction"] == "setting")
            {
                model.ListMenuGroupsItem = _bl.GetMenusGroup();
                var key = _sysbl.GetKey(ctrId);
                model.PageId = key != null?int.Parse(key.Value) : 0;

                return(PartialView(model));
            }
            else
            {
                var urlpath = Request.Path.Split('/');
                model.CtrUrl = url;
                var key = _sysbl.GetKey(ctrId);
                var val = key != null?int.Parse(key.Value) : 1;

                model.ListItem = _bl.GetListMenus(val);
                model.Slug     = slug;
                model.Url      = urlpath.Length > 1 ? urlpath[1] : urlpath[0];
                var codeCookie = HttpContext.Request.Cookies["addtocart"];
                if (codeCookie == null)
                {
                    model.CountCart = 0;
                }
                else
                {
                    var temp = codeCookie.Value;
                    var lst  = new JavaScriptSerializer().Deserialize <List <ShopProductDetailCartItem> >(temp);
                    model.CountCart = lst.Count;
                }
                return(PartialView(model));
            }
        }