Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BLL.menus bmenus = new BLL.menus();

            productParentmenu = bmenus.GetList().Find(c => c.linktag == "product");
            productMenulist   = bmenus.GetList().FindAll(c => c.parentid == productParentmenu.id);//只取一层级

            colorParentmenu = bmenus.GetList().Find(c => c.linktag == "color");
            colorMenulist   = bmenus.GetList().FindAll(c => c.parentid == colorParentmenu.id);//只取一层级
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            header1.msite = footer1.msite = msite;
            mmenu         = bmenus.GetList("linktag='" + linktag + "'")[0];
            var temp = bposts.GetList("ext='widgets' and ext1 = '产品首页' ");

            JC.Common.LogHelper.Info(Newtonsoft.Json.JsonConvert.SerializeObject(temp));
            if (temp != null && temp.Count > 0)
            {
                mpost = temp[0];
            }
        }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     mymenuid = Request.QueryString["id"];
     menus    = bmenus.GetListByPage("", "path asc", 0, 100);
     if (!string.IsNullOrEmpty(mymenuid))
     {
         menu = menus.Find(c => c.id == Int32.Parse(mymenuid));
         if (menu != null)
         {
             myparentid = menu.parentid.ToString();
             mypath     = menu.path;
         }
     }
 }
Esempio n. 4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public JC.Model.menus Get(int id)
        {
            object objModel = JC.Common.DataCache.Get(cacName);

            JC.Model.menus md = new Model.menus();
            if (objModel != null)
            {
                List <JC.Model.menus> modelList = (List <JC.Model.menus>)objModel;
                if (modelList != null && modelList.Count > 0)
                {
                    md = modelList.Find(c => c.id == id);
                }
            }
            else
            {
                md = dal.GetModel(id);
            }
            return(md);
        }
Esempio n. 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var id = Request.QueryString["id"];

            menus = bmenus.GetListByPage("", "path asc", 0, 100);

            if (!string.IsNullOrEmpty(id))
            {
                post = bposts.Get(int.Parse(id));
            }

            //VIP Code
            var obj = Common.JsonHelper.GetJsonSiteObject();

            tags = (List <string>)obj["posts"][mymodule]["tag"].ToObject(typeof(List <string>));

            //无论如何,禁止更多下拉菜单选项
            menu       = menus.FindAll(c => c.linktag == mymodule)[0];
            myparentid = menu.parentid.ToString();
            mypath     = menu.path;
        }
Esempio n. 6
0
        public string fix        = " and top=1 ";//置顶

        protected void Page_Load(object sender, EventArgs e)
        {
            header1.msite = footer1.msite = msite;
            mmenu         = bmenus.GetList("linktag='" + tbs + "'")[0];
            postfocus     = bposts.GetList(ext + enable + fix);

            typeid = Request.QueryString["typeid"];

            if (!string.IsNullOrEmpty(typeid))
            {
                typeid = "and typeid='" + typeid + "'";//ext1属性分类字段
            }

            if (!IsPostBack)
            {
                pager1.RecordCount = bposts.Count(ext + typeid + enable);
            }

            Pager(ext + typeid + enable);

            //仅取二级菜单数据
            menuLevel2List = bmenus.GetList(" parentid= " + mmenu.id);
        }
Esempio n. 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var id = Request.QueryString["id"];

            menus = bmenus.GetListByPage("", "path asc", 0, 100);

            if (!string.IsNullOrEmpty(id))
            {
                post = bposts.Get(int.Parse(id));

                menu = menus.Find(c => c.id == post.typeid);
                if (menu != null)
                {
                    myparentid = menu.parentid.ToString();
                    mypath     = menu.path;
                }

                ////无论如何,禁止更多下拉菜单选项
                //menu = menus.FindAll(c => c.linktag == mymodule)[0];
                //myparentid = menu.parentid.ToString();
                //mypath = menu.path;
            }
        }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            header1.msite = footer1.msite = msite;
            mmenu         = bmenus.GetList("linktag='" + tbs + "'")[0];

            tag = Request.QueryString["tag"];

            if (!string.IsNullOrEmpty(tag))
            {
                tag = "and tag='" + tag + "'";//ext1属性分类字段
            }

            if (!IsPostBack)
            {
                pager1.RecordCount = bposts.Count(ext + tag + enable);
            }

            Pager(ext + tag + enable);

            //仅取二级菜单数据
            var obj = Common.JsonHelper.GetJsonSiteObject();

            menuLevel2List = (List <string>)obj["posts"][tbs]["tag"].ToObject(typeof(List <string>));
        }
Esempio n. 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     header1.msite = footer1.msite = msite;
     mmenu         = bmenus.GetList("linktag='" + linktag + "'")[0];
 }
Esempio n. 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     BLL.menus bmenus = new BLL.menus();
     parentmenu = bmenus.GetList().Find(c => c.linktag == linktag);
     menulist   = bmenus.GetList().FindAll(c => c.parentid == parentmenu.id);//只取一层级
 }
Esempio n. 11
0
 // GET: api/Menus/5
 public string Get(int id)
 {
     model = bll.Get(id);
     return(JsonConvert.SerializeObject(model));
 }
Esempio n. 12
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            //Response.Write(JsonConvert.SerializeObject(Request.Form));
            //Response.Write(JsonConvert.SerializeObject(menu));

            menu.linktag = Request.Form["linktag"];

            menu.path     = string.IsNullOrEmpty(Request.Form["path"]) ? "-" : Request.Form["path"];
            menu.parentid = int.Parse(string.IsNullOrEmpty(Request.Form["parentid"]) ? "0" : Request.Form["parentid"]);

            menu.title       = Request.Form["title"];
            menu.keywords    = JC.Common.Common.ToDBC(Request.Form["keywords"]);
            menu.description = Server.HtmlEncode(Request.Form["description"]);
            menu.content     = Server.HtmlEncode(Request.Form["content"]);

            menu.titleen       = Request.Form["titleen"];
            menu.keywordsen    = JC.Common.StringPlus.ToDBC(Request.Form["keywordsen"]);
            menu.descriptionen = Server.HtmlEncode(Request.Form["descriptionen"]);
            menu.contenten     = Server.HtmlEncode(Request.Form["contenten"]);

            menu.pic     = Request.Form["pic"];
            menu.orderby = int.Parse(Request.Form["orderby"]);

            //-----------------------------------------

            Model.logs lg = new Model.logs();
            if (menu != null && menu.id != 0)
            {
                bmenus.Update(menu);

                lg.loginfo = "表:" + mytablename + ",ID:" + menu.id;
                UserLog("修改", lg);
            }
            else
            {
                var pathArr = menu.path.Trim('-').Split('-');
                if (pathArr.Length == 1 && string.IsNullOrEmpty(pathArr[0]))
                {
                    pathArr[0] = "0";
                }
                menu.parentid = (Int32.Parse(pathArr[pathArr.Length - 1]));//倒数第二个

                var latestid = bmenus.Add(menu);

                //新增之后,更新细节
                menu = bmenus.Get(latestid);

                if (string.IsNullOrEmpty(menu.path))
                {
                    menu.path = "-";
                }

                menu.path = menu.path + latestid + '-';
                bmenus.Update(menu);

                lg.loginfo = "表:" + mytablename + ",ID:" + latestid;
                UserLog("增加", lg);
            }


            //更新扩展信息
            FixMenus();

            txtMsg.Style["display"] = "block";

            txtMsg.Attributes["class"] = "callout callout-info";
        }
Esempio n. 13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     header1.msite = footer1.msite = msite;
     mposts        = bposts.GetList("ext='" + tbs + "' and enable=1 and top=1 ");
     mmenu         = bmenus.GetList(" linktag='" + tbs + "'")[0];
 }