Esempio n. 1
0
        public void updatename(HttpContext context)
        {
            context.Response.ContentType = "application/json;charset=utf-8";
            context.Response.Charset     = "utf-8";
            string s   = "{\"status\":\"1\"}";
            int    num = 0;

            if (!int.TryParse(context.Request["MenuId"], out num))
            {
                s = "{\"status\":\"1\"}";
            }
            else
            {
                if (num > 0)
                {
                    ShopMenuInfo menu = ShopMenuHelper.GetMenu(num);
                    menu.Name   = context.Request["Name"];
                    menu.MenuId = num;
                    if (ShopMenuHelper.UpdateMenu(menu))
                    {
                        s = "{\"status\":\"0\"}";
                    }
                }
                context.Response.Write(s);
            }
        }
Esempio n. 2
0
        public void EditMenus(HttpContext context)
        {
            context.Response.ContentType = "application/json;charset=utf-8";
            context.Response.Charset     = "utf-8";
            string       s            = "{\"status\":\"1\"}";
            ShopMenuInfo shopMenuInfo = new ShopMenuInfo();

            shopMenuInfo.Content = context.Request["Content"];
            shopMenuInfo.Name    = context.Request["Name"];
            shopMenuInfo.Type    = context.Request["Type"];
            if (!string.IsNullOrEmpty(context.Request["ParentMenuId"]))
            {
                shopMenuInfo.ParentMenuId = int.Parse(context.Request["ParentMenuId"]);
            }
            else
            {
                shopMenuInfo.ParentMenuId = 0;
            }
            int menuId = 0;

            if (!int.TryParse(context.Request["MenuId"], out menuId))
            {
                s = "{\"status\":\"1\"}";
            }
            else
            {
                shopMenuInfo.MenuId      = menuId;
                shopMenuInfo.ShopMenuPic = this.SaveMenuPic(context.Request["ShopMenuPic"]);
                if (ShopMenuHelper.UpdateMenu(shopMenuInfo))
                {
                    s = "{\"status\":\"0\"}";
                }
                context.Response.Write(s);
            }
        }