Exemplo n.º 1
0
        public static string LoadingList(string comid, int pageindex, int pagesize, int userid)
        {
            var totalcount = 0;

            try
            {
                var list = new List <Member_Activity_Log>();
                B2b_company_manageuser userr = B2bCompanyManagerUserData.GetUser(userid);
                if (userr != null)
                {
                    if (userr.Channelcompanyid == 0)//总公司账户
                    {
                        list = new B2bCrmData().LoadingList(comid, pageindex, pagesize, out totalcount);
                    }
                    else //总公司下面渠道
                    {
                        list = new B2bCrmData().LoadingList(comid, pageindex, pagesize, int.Parse(userr.Channelcompanyid.ToString()), out totalcount);
                    }


                    IEnumerable result     = "";
                    var         memcompany = new MemberChannelcompanyData();
                    if (list != null)
                    {
                        result = from pro in list
                                 select new
                        {
                            ID     = pro.ID,
                            CardID = MemberCardData.GetCardId(pro.CardID).Cardcode.ToString(),
                            //CardID =pro.CardID,
                            ACTID               = MemberActivityData.GetActById(pro.ACTID).Title.ToString(),
                            OrderId             = pro.OrderId,
                            ServerName          = pro.ServerName,
                            Sales_admin         = pro.Sales_admin,
                            Num_people          = pro.Num_people,
                            Usesubdate          = pro.Usesubdate,
                            Per_capita_money    = pro.Per_capita_money * pro.Num_people,
                            Member_return_money = pro.Member_return_money,
                            username            = B2bCrmData.GetCrmCardcode(MemberCardData.GetCardId(pro.CardID).Cardcode) == null ? "--" : B2bCrmData.GetCrmCardcode(MemberCardData.GetCardId(pro.CardID).Cardcode).Name.ToString(),
                            channel             = memcompany.UpCompanyById(MemberCardData.GetCardId(pro.CardID).Cardcode.ToString())
                        }
                    }
                    ;

                    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;
            }
        }
Exemplo n.º 2
0
        public static string Logcardact(int actid, int cardid, int comid)
        {
            var totalcount = 0;

            try
            {
                var         prodata    = new B2bCrmData();
                var         list       = prodata.Logcardact(actid, cardid, comid, out totalcount);
                IEnumerable result     = "";
                var         memcompany = new MemberChannelcompanyData();
                if (list != null)
                {
                    result = from pro in list
                             select new
                    {
                        ID     = pro.ID,
                        CardID = MemberCardData.GetCardId(pro.CardID).Cardcode,
                        ACTID  = MemberActivityData.GetActById(pro.ACTID).Title,
                        //OrderId = pro.OrderId,
                        ServerName = pro.ServerName,
                        //Sales_admin = pro.Sales_admin,
                        //Num_people = pro.Num_people,
                        Usesubdate       = pro.Usesubdate,
                        Per_capita_money = pro.Per_capita_money * pro.Num_people,
                        //Member_return_money = pro.Member_return_money,
                    }
                }
                ;

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

                throw;
            }
        }