コード例 #1
0
        public static string GetMenuByComid(int comid, int id)
        {
            try
            {
                int totalcount1            = 0;
                int selectpro              = 0;
                int totalcount2            = 0;
                List <WxMaterial> Material = null;
                var actdata                = new WxMaterialData();
                B2b_company_menu list      = B2bCompanyMenuData.GetMenuByComid(comid, id);
                var prodata                = new B2bComProData();
                List <B2b_com_pro> Prolist = null;
                IEnumerable        result  = "";
                if (list != null)
                {
                    Prolist             = prodata.Selectpagelist_diaoyong(comid.ToString(), 1, 12, "", out totalcount1, list.Projectlist, 0, id);//读出每个栏目的产品,每页12个
                    selectpro           = prodata.Selectpagelist_ct(comid.ToString(), id);
                    list.Imgurl_address = FileSerivce.GetImgUrl(list.Imgurl);
                    Material            = list.Menutype == 0 ? null : actdata.ShopWxMaterialPageList(comid, 1, 12, 10, id, list.Projectlist, out totalcount2, "");
                }


                return(JsonConvert.SerializeObject(new { type = 100, msg = list, prolist = Prolist, selectpro = selectpro, Materiallist = Material }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));
            }
        }
コード例 #2
0
        public static string Getmenulist(int comid, int pageindex, int pagesize, int usetype = 0, int menuindex = 0)
        {
            int totalcount  = 0;
            int totalcount1 = 0;
            int totalcount2 = 0;
            int totalcount3 = 0;

            try
            {
                var imagedata   = new B2bCompanyMenuData();
                var prodata     = new B2bComProData();
                var actdata     = new WxMaterialData();
                var projectdata = new B2b_com_projectData();
                List <B2b_company_menu> list   = imagedata.GetMenuList(comid, pageindex, pagesize, out totalcount, usetype, menuindex);
                IEnumerable             result = "";
                if (list != null)
                {
                    result = from pro in list
                             select new
                    {
                        Id             = pro.Id,
                        Com_id         = pro.Com_id,
                        Imgurl_address = FileSerivce.GetImgUrl(pro.Imgurl),
                        Imgurl         = pro.Imgurl,
                        Linkurl        = pro.Linkurl,
                        Name           = pro.Name,
                        Fonticon       = pro.Fonticon,
                        Usestyle       = pro.Usestyle,
                        Menutype       = pro.Menutype,
                        Usetype        = pro.Usetype,
                        Projectlist    = pro.Projectlist,
                        menuindex      = pro.menuindex,
                        menuviewtype   = pro.menuviewtype,
                        hotellist      = pro.menuviewtype == 1 ? projectdata.Projectpagelist(comid.ToString(), 1, 12, "1", out totalcount3, "", 1, pro.Projectlist, 9) : null,
                        prolist        = pro.Menutype == 0 ? prodata.Selectpagelist_diaoyong(comid.ToString(), 1, 12, "", out totalcount1, pro.Projectlist, 0, pro.Id) : null,//读出每个栏目的产品,每页12个
                        Materiallist   = pro.Menutype == 0 ? null : actdata.ShopWxMaterialPageList(comid, 1, 12, 10, pro.Id, pro.Projectlist, out totalcount2, "")
                    };
                }

                return(JsonConvert.SerializeObject(new { type = 100, msg = result, totalCount = totalcount }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));
            }
        }