示例#1
0
        public static string fuwuPageList(string comid, int pageindex, int pagesize, int user)
        {
            var totalcount = 0;

            try
            {
                var         prodata    = new B2bCrmData();
                var         list       = prodata.fuwuPageList(comid, pageindex, pagesize, user, out totalcount);
                IEnumerable result     = "";
                var         memcompany = new MemberChannelcompanyData();
                if (list != null)
                {
                    result = from pro in list
                             select new
                    {
                        id           = pro.Id,
                        comid        = pro.Com_id,
                        phone        = pro.Phone,
                        registerdate = pro.Regidate,
                        customername = pro.Name,
                        imprest      = pro.Imprest,
                        integral     = pro.Integral,
                        idcard       = pro.Idcard,
                        email        = pro.Email,
                        serverid     = pro.Servercard,
                        winxin       = pro.Weixin == null || pro.Weixin == "" ? "" : "yes",
                        channel      = memcompany.UpCompanyById(pro.Idcard.ToString()),
                        referrer     = MemberChannelData.Upstring(pro.Idcard.ToString()).Name.ToString()
                    }
                }
                ;

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

                throw;
            }
        }
示例#2
0
        public static string SJKeHuPageList(string comid, int pageindex, int pagesize, int userid)
        {
            var totalcount = 0;

            try
            {
                var list = new List <B2b_crm>();

                B2b_company_manageuser userr = B2bCompanyManagerUserData.GetUser(userid);
                if (userr != null)
                {
                    if (userr.Channelcompanyid == 0)//总公司账户,根据comid得到crm
                    {
                        list = new B2bCrmData().SJKeHuPageList(comid, pageindex, pagesize, out totalcount);
                    }
                    else //总公司下面渠道,渠道表+卡号表+会员表连接查询得到渠道下的crm
                    {
                        list = new B2bCrmData().SJKeHuPageList(comid, pageindex, pagesize, userr, out totalcount);
                    }



                    IEnumerable result = "";

                    if (list != null)
                    {
                        result = from pro in list
                                 select new
                        {
                            id           = pro.Id,
                            comid        = pro.Com_id,
                            phone        = pro.Phone,
                            registerdate = pro.Regidate,
                            customername = pro.Name,
                            imprest      = pro.Imprest,
                            integral     = pro.Integral,
                            idcard       = pro.Idcard,
                            email        = pro.Email == null || pro.Email == "" ? "" : pro.Email,
                            serverid     = pro.Servercard,
                            winxin       = pro.Weixin == "" ? "" : "yes",
                            channel      = new MemberChannelcompanyData().UpCompanyById(pro.Idcard.ToString()),
                            referrer     = MemberChannelData.Upstring(pro.Idcard.ToString()) == null ? "" : MemberChannelData.Upstring(pro.Idcard.ToString()).Name.ToString(),

                            WxHeadimgurl = pro.WxHeadimgurl,
                            WxNickname   = pro.WxNickname,
                            WxProvince   = pro.WxProvince,
                            WxCity       = pro.WxCity,
                            WxSex        = pro.WxSex == 0 ? "未知" : pro.WxSex == 1 ? "男" : "女"
                        }
                    }
                    ;

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

                throw;
            }
        }