public ActionResult About(string id)
 {
     if (string.IsNullOrEmpty(id))
         return Content("<script>alert(\"参数错误\");location.href=\"/\"</script>", "text/html");
     Class m = new Class();
     if (CheckRoleService.instance().CheckRole_ClassID(new Guid(id), UserDateTicket.UID))
         m = ClassService.instance().GetEnumByID(new Guid(id)).FirstOrDefault();
     else
         return Content("<script>alert(\"没有权限\")</script>", "text/html");
     return View(m);
 }
Esempio n. 2
0
        /// <summary>
        /// 新增商品分类
        /// </summary>
        /// <param name="access_token"></param>
        /// <param name="classid"></param>
        /// <returns></returns>
        public static string vdian_shop_cate_add(string access_token, Class c)
        {

            List<cates> calist = new List<cates>();
            calist.Add(new cates()
            {
                cate_name = c.Title,
                sort_num = c.Sort
            });
            @public p = new @public("vdian.shop.cate.add", access_token);
            StringBuilder str = new StringBuilder();
            str.Append("{");
            str.Append("\"cates\":" + JsonHelper.SerializeObject(calist));
            str.Append("}&public=");
            str.Append(JsonHelper.SerializeObject(p));
            return str.ToString();
        }
 public ActionResult Create(string id, string pid)
 {
     if (string.IsNullOrEmpty(id))
         return Content("<script>alert(\"参数错误\");location.href=\"/\"</script>", "text/html");
     Class ml = new Class();
     if (CheckRoleService.instance().CheckRole_ClassID(new Guid(id), UserDateTicket.UID))
         ml = ClassService.instance().GetEnumByID(new Guid(id)).FirstOrDefault();
     else
         return Content("<script>alert(\"没有权限\")</script>", "text/html");
     Product m = new Product();
     if (string.IsNullOrEmpty(pid))
         m = new Product();
     else
         m = ProductService.instance().GetEnumByID(new Guid(pid)).FirstOrDefault();
     ViewBag.ClassName = ml.Title;
     ViewBag.ClassID = ml.ID;
     return View(m);
 }
 public ActionResult Create(string id, string nid)
 {
     if (string.IsNullOrEmpty(id))
         return Content("<script>alert(\"参数错误\");location.href=\"/\"</script>", "text/html");
     Class ml = new Class();
     if (CheckRoleService.instance().CheckRole_ClassID(new Guid(id), UserDateTicket.UID))
         ml = ClassService.instance().GetEnumByID(new Guid(id)).FirstOrDefault();
     else
         return Content("<script>alert(\"没有权限\")</script>", "text/html");
     News m = new News();
     if (string.IsNullOrEmpty(nid))
         m = new News();
     else {
         m = NewsService.instance().GetEnumByID(new Guid(nid)).FirstOrDefault();
         Files file = FilesService.instance().Single(new Guid(nid));
         ViewBag.filepath = file == null ? "" : file.FilePath;
     }
     ViewBag.ClassID = id;
     return View(m);
 }
 private WxJsonResult groupdel(Class m)
 {
     return ComShopApi.DeleteGroup(GetToken(), m.wx_group_id);
 }
 private WxJsonResult groupedit(Class m)
 {
     return ComShopApi.PropertyModGroup(GetToken(), new PropertyModGroup()
     {
         group_id = m.wx_group_id,
         group_name = m.Title
     });
 }
 private AddGroupResult groupadd(Class m)
 {
     return ComShopApi.AddGroup(GetToken(), new AddGroupData()
     {
         group_detail = new GroupDetail()
         {
             group_name = m.Title
         }
     });
 }
Esempio n. 8
0
        private string GetClassAndChildHtml(Class cl)
        {


            StringBuilder str = new StringBuilder();
            str.Append("<li class=\"dropdown\">");
            str.Append("<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">");
            str.Append("<i class=\"fa fa-list\"></i> " + cl.Title + "管理 <b class=\"fa fa-plus dropdown-plus\"></b>");
            str.Append("</a>");
            str.Append("<ul class=\"dropdown-menu\">");
            str.Append("<li><a href=\"/General/About/" + cl.ID + "\"> <i class=\"fa fa-tint\"></i> " + cl.Title + "介绍 </a> </li>");
            foreach (var item in cl.Childs.OrderBy(m => m.Type))
            {
                switch (item.Type)
                {
                    case 0:
                        str.Append("<li><a href=\"/General/About/" + item.ID + "\"> <i class=\"fa fa-tint\"></i> " + item.Title + " </a> </li>");
                        break;
                    case 1:
                        str.Append("<li>");
                        str.Append("<a href=\"/General/NewList/" + item.ID + "\">");
                        str.Append("<i class=\"fa fa-caret-right\"></i>" + item.Title + "列表");
                        str.Append("</a>");
                        str.Append("<a href=\"/General/NewEdit/" + item.ID + "\">");
                        str.Append("<i class=\"fa fa-caret-right\"></i>添加" + item.Title + "");
                        str.Append("</a></li>");
                        break;
                    default:
                        break;
                }

            }
            str.Append("</ul></li>");
            return str.ToString();
        }
Esempio n. 9
0
 private string GetClassHtml(Class cl)
 {
     switch (cl.Type)
     {
         case 0:
             return
                 "<li><a href=\"/General/About/" + cl.ID + "\"> <i class=\"fa fa-tint\"></i> " + cl.Title + " </a> </li>";
         case 1:
             StringBuilder str = new StringBuilder();
             str.Append("<li class=\"dropdown\">");
             str.Append("<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">");
             str.Append("<i class=\"fa fa-list\"></i> " + cl.Title + "管理 <b class=\"fa fa-plus dropdown-plus\"></b>");
             str.Append("</a>");
             str.Append("<ul class=\"dropdown-menu\">");
             str.Append("<li>");
             str.Append("<a href=\"/General/NewList/" + cl.ID + "\">");
             str.Append("<i class=\"fa fa-caret-right\"></i>" + cl.Title + "列表");
             str.Append("</a>");
             str.Append("<a href=\"/General/NewEdit/" + cl.ID + "\">");
             str.Append("<i class=\"fa fa-caret-right\"></i>添加" + cl.Title + "");
             str.Append("</a></li></ul></li>");
             return str.ToString();
         default:
             return "";
     }
 }