예제 #1
0
        public string GetRetailTradersBySellUser(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <SellUserMainAchieveRP> >();

            if (string.IsNullOrEmpty(rp.UserID))
            {
                throw new APIException("缺少参数【UserID】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }

            var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, "1");
            var bll = new RetailTraderBLL(loggingSessionInfo);
            var rd  = new GetRetailTradersBySellUserRD();
            var rsp = new SuccessResponse <IAPIResponseData>(rd);
            //获取分销商的信息,loggingSessionInfo.ClientID
            var ds = bll.GetRetailTradersBySellUser(rp.Parameters.RetailTraderName, rp.UserID, loggingSessionInfo.ClientID);   //获取

            //判断账号是否存在
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                var tempDt = ds.Tables[0];
                rd.RetailTraderList = DataTableToObject.ConvertToList <RetailTraderInfo>(tempDt);//直接根据所需要的字段反序列化
            }

            return(rsp.ToJSON());
        }
예제 #2
0
        public string SellUserMainAchieve(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <SellUserMainAchieveRP> >();

            if (string.IsNullOrEmpty(rp.UserID))
            {
                throw new APIException("缺少参数【UserID】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }

            var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, "1");
            var bll = new RetailTraderBLL(loggingSessionInfo);
            var rd  = new SellUserMainAchieveRD();
            var rsp = new SuccessResponse <IAPIResponseData>(rd);
            //获取分销商的信息,loggingSessionInfo.ClientID
            var ds = bll.GetRetailTradersBySellUser("", rp.UserID, loggingSessionInfo.ClientID);   //获取

            //判断账号是否存在
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                rd.RetailTraderCount = ds.Tables[0].Rows.Count;
            }
            else
            {
                rd.RetailTraderCount = 0;
            }
            //取该账号下面的分销商的会员的数量
            int VipCount = bll.GetVipCountBySellUser(rp.UserID, loggingSessionInfo.ClientID);   //获取

            rd.VipCount = VipCount;

            //销售员头像
            ObjectImagesBLL    _ObjectImagesBLL = new ObjectImagesBLL(loggingSessionInfo);
            ObjectImagesEntity en = new ObjectImagesEntity();

            en.ObjectId = rp.UserID;
            List <ObjectImagesEntity> ImgList = _ObjectImagesBLL.QueryByEntity(en, null).OrderByDescending(p => p.CreateTime).ToList();

            if (ImgList != null && ImgList.Count != 0)
            {
                // string fileDNS = customerBasicSettingBll.GetSettingValueByCode("FileDNS"); ;//http://182.254.156.57:811
                rd.HeadImg = ImgList[0].ImageURL;
            }


            return(rsp.ToJSON());
        }