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

            var memberdata = new MemberChannelData();
            MemberChannelcompanyData channel = new MemberChannelcompanyData();

            try
            {
                var         list   = new B2bCompanyManagerUserData().Manageuserpagelist(employstate, comid, pageindex, pagesize, out totalcount, userid, key);
                IEnumerable result = "";
                if (list != null)
                {
                    result = from model in list
                             select new
                    {
                        model.Id,
                        Accounts       = model.Accounts,
                        PassWord       = model.Passwords,
                        MasterId       = model.Id,
                        MasterName     = model.Employeename,
                        CompanyName    = channel.GetCompanyById(Int32.Parse(model.Channelcompanyid.ToString())) != null?channel.GetCompanyById(Int32.Parse(model.Channelcompanyid.ToString())).Companyname : "",
                        Tel            = model.Tel,
                        GroupName      = new Sys_MasterGroupData().GetGroupNameStrByMasterId(model.Id),
                        Employstate    = model.Employeestate,
                        weixinstate    = memberdata.GetChannelListByComidState(int.Parse(comid), model.Id),
                        Peoplelistview = model.Peoplelistview,
                        Workdays       = model.Workdays,
                        Isdefaultkf    = model.Isdefaultkf,

                        Channelid        = new MemberChannelData().GetChannelid(model.Com_id, model.Tel),                        //渠道id
                        rebatenum        = new Member_channel_rebatelogData().Getrebatenum(model.Com_id, model.Tel),             //返佣次数
                        rebateapplytotal = new Member_channel_rebateApplylogData().Getrebateapplytotal(model.Com_id, model.Tel), //返佣申请总额
                        rebatehastixian  = new Member_channel_rebateApplylogData().Getrebatehastixian(model.Com_id, model.Tel),  //返佣申请已提现金额
                        rebatenottixian  = new Member_channel_rebateApplylogData().Getrebatenottixian(model.Com_id, model.Tel),  //返佣申请尚未提现金额
                        restrebate       = new MemberChannelData().Getrestrebate(model.Com_id, model.Tel),                       //剩余可申请返佣金额
                    }
                }
                ;

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

                throw;
            }
        }
Exemplo n.º 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;
            }
        }