Пример #1
0
        public static string Readuser(int id, int comid)
        {
            try
            {
                var prodata = new B2bCrmData();
                var list    = prodata.Readuser(id, comid);
                var rename  = MemberChannelData.GetChannelinfo(int.Parse(MemberCardData.GetCardNumber(list.Idcard).IssueCard.ToString()));
                var memcard = MemberChannelData.GetChannelinfo(int.Parse(MemberCardData.GetCardNumber(list.Idcard).ServerCard.ToString()));

                return(JsonConvert.SerializeObject(new { type = 100, msg = list, Namechannl = rename, Mem = memcard }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));

                throw;
            }
        }
Пример #2
0
        public static string SearchActivityList(string comid, int pageindex, int pagesize, string key, string ServerName, int userid)
        {
            var  totalcount = 0;
            bool isNum      = Domain_def.RegexValidate("^[0-9]*$", key);

            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().SearchActivityList(comid, pageindex, pagesize, key, ServerName, isNum, out totalcount);
                    }
                    else //总公司下面渠道
                    {
                        list = new B2bCrmData().SearchActivityList(comid, pageindex, pagesize, key, ServerName, isNum, 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,
                            //CardID =pro.CardID,
                            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,
                            username            = B2bCrmData.GetCrmCardcode(MemberCardData.GetCardId(pro.CardID).Cardcode) == null ? "--" : B2bCrmData.GetCrmCardcode(MemberCardData.GetCardId(pro.CardID).Cardcode).Name.ToString(),
                            channel             = MemberChannelData.GetChannelinfo(int.Parse(MemberCardData.GetCardNumber(MemberCardData.GetCardId(pro.CardID).Cardcode).IssueCard.ToString())) == null ? "--" : memcompany.GetCompanyById(MemberChannelData.GetChannelinfo(int.Parse(MemberCardData.GetCardNumber(MemberCardData.GetCardId(pro.CardID).Cardcode).IssueCard.ToString())).Companyid).Companyname.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;
            }
        }