コード例 #1
0
        public static string GetAllInnerChannels()
        {
            var totalcount = 0;

            try
            {
                var         prodata = new MemberChannelData();
                var         list    = prodata.GetAllInnerChannels(out totalcount);
                IEnumerable result  = "";
                if (list != null)
                {
                    result = from pro in list
                             select new
                    {
                        Id        = pro.Id,
                        Com_id    = pro.Com_id,
                        Issuetype = pro.Issuetype,
                        //CompanyName = new MemberChannelcompanyData().GetCompanyById(pro.Companyid).Companyname,
                        CompanyName    = pro.Issuetype == 3 ? "网站渠道" : (pro.Issuetype == 4 ? "微信渠道" : new MemberChannelcompanyData().GetCompanyById(pro.Companyid).Companyname),
                        Name           = pro.Name,
                        Mobile         = pro.Mobile,
                        ChObjects      = pro.ChObjects,
                        Cardcode       = pro.Cardcode,
                        Chaddress      = pro.Chaddress,
                        RebateOpen     = pro.RebateOpen,
                        RebateConsume  = pro.RebateConsume,
                        RebateConsume2 = pro.RebateConsume2,
                        RebateLevel    = pro.RebateLevel == 0 ? "普通" : "暂时未设",
                        //添加录入量,开卡量,第一次交易量,金额
                        OpenCardNum  = pro.Opencardnum,
                        Firstdealnum = pro.Firstdealnum,
                        Summoney     = pro.Summoney,
                        companyid    = pro.Companyid,

                        EnterCardNum = new MemberCardData().GetEnteredNumberByChannelId(pro.Id)
                    }
                }
                ;

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

                throw;
            }
        }