Пример #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 GetConsultantByComid(int comid, int id)
        {
            try
            {
                B2b_company_menu com          = B2bCompanyMenuData.GetConsultantByComid(comid, id);
                var prodata                   = new B2bComProData();
                var actdata                   = new WxMaterialData();
                List <B2b_com_pro> Prolist    = null;
                List <WxMaterial>  WxMaterial = null;
                int totalcount1               = 0;


                if (com.Outdata == 0)
                {
                    Prolist = prodata.Selectpagelist_diaoyong(comid.ToString(), 1, 50, "", out totalcount1, 0, 0, 0, id);//读出每个栏目的产品,每页12个
                }
                if (com.Outdata == 2)
                {
                    WxMaterial = actdata.WxMaterialPageList(comid, 1, 100, 10, 1000000, out totalcount1, "", 0, id);
                }
                return(JsonConvert.SerializeObject(new { type = 100, msg = com, Prolist = Prolist, WxMaterial = WxMaterial }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));
            }
        }
Пример #3
0
 public static string GetChannelProList(int comid, int id)
 {
     try
     {
         var prodata     = new B2bComProData();
         int totalcount1 = 0;
         var Prolist     = prodata.Selectpagelist_diaoyong(comid.ToString(), 1, 50, "", out totalcount1, 0, 0, 0, id);//读出每个栏目的产品,每页12个
         return(JsonConvert.SerializeObject(new { type = 100, msg = Prolist }));
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));
     }
 }
Пример #4
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 }));
            }
        }
Пример #5
0
        public static string GetAccountInfo(int userid)
        {
            try
            {
                B2b_company_manageuser manageruser = B2bCompanyManagerUserData.GetUser(userid);
                if (manageruser == null)
                {
                    return(JsonConvert.SerializeObject(new { type = 1, msg = "null" }));
                }
                else
                {
                    var list = new List <B2b_company_manageuser>();
                    list.Add(manageruser);

                    IEnumerable result = "";
                    if (list != null)
                    {
                        result = from model in list
                                 select new
                        {
                            Accounts           = model.Accounts,
                            PassWord           = model.Passwords,
                            MasterId           = model.Id,
                            MasterName         = model.Employeename,
                            CompanyName        = B2bCompanyData.GetCompanyByUid(model.Id).Com_name,
                            Tel                = model.Tel,
                            Viewtel            = model.Viewtel,
                            GroupNames         = new Sys_MasterGroupData().GetGroupNameStrByMasterId(model.Id),
                            GroupIds           = new Sys_MasterGroupData().GetGroupIdStrByMasterId(model.Id),
                            ChannelCompanyId   = model.Channelcompanyid,
                            ChannelCompanyName = model.Channelcompanyid == 0 ? "全部渠道" : new MemberChannelcompanyData().GetCompanyById(model.Channelcompanyid.ToString().ConvertTo <int>(0)).Companyname,
                            Channelsource      = model.Channelsource,
                            CreateUserId       = model.Createuserid,
                            EmployeState       = model.Employeestate,

                            Job          = model.Job,
                            Selfbrief    = model.Selfbrief,
                            Headimg      = model.Headimg,
                            Headimgurl   = FileSerivce.GetImgUrl(model.Headimg),
                            Workingyears = model.Workingyears,
                            Workdays     = model.Workdays,
                            Workdaystime = model.Workdaystime,
                            Workendtime  = model.Workendtime,

                            //WorkAddress=new B2bCompanyData().GetWordAddressByChannelCompany(model.Channelcompanyid,model.Com_id),

                            Fixphone  = model.Fixphone,
                            Email     = model.Email,
                            Homepage  = model.Homepage,
                            Weibopage = model.Weibopage,
                            QQ        = model.QQ,
                            Weixin    = model.Weixin,
                            Selfhomepage_qrcordurl = model.Selfhomepage_qrcordurl,
                            Peoplelistview         = model.Peoplelistview,
                            worktimestar           = model.worktimestar,
                            worktimeend            = model.worktimeend,
                            workendtimestar        = model.workendtimestar,
                            workendtimeend         = model.workendtimeend,
                            bindingproid           = model.bindingproid,
                        }
                    }
                    ;

                    //读取产品,渠道自定义产品
                    var prodata  = new B2bComProData();
                    var menudata = new B2bCompanyMenuData();
                    List <B2b_com_pro> Prolist = null;
                    int projcetid = 0;
                    var channelid = new MemberChannelData().GetChannelidbymanageuserid(userid, manageruser.Com_id);
                    if (channelid != 0)
                    {
                        int totalcount1 = 0;
                        Prolist   = prodata.Selectpagelist_diaoyong(manageruser.Com_id.ToString(), 1, 50, "", out totalcount1, 0, 0, 0, 0, channelid);//读出每个栏目的产品,每页12个
                        projcetid = menudata.selectprojceidbychannelid(manageruser.Com_id, channelid);
                    }


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