コード例 #1
0
        /// <summary>
        /// 根据CustomerId获取成为经销商条件
        /// </summary>
        /// <param name="pRequest"></param>
        /// <returns></returns>
        private string GetVipMultiLevelSalerConfig(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <EmptyRequestParameter> >();

            if (string.IsNullOrEmpty(rp.UserID))
            {
                throw new APIException("缺少参数【UserID】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }
            var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, "1");
            var RetailTraderBLL    = new RetailTraderBLL(loggingSessionInfo);
            var ds = RetailTraderBLL.GetVMultiLevelSalerConfigByCId(rp.CustomerID);

            var rd = new VipMultiLevelSalerConfigRP();

            rd.config = new VipMultiLevelSalerConfigEntity();
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                rd.config.Id            = ds.Tables[0].Rows[0]["Id"].ToString();
                rd.config.MustBuyAmount = ds.Tables[0].Rows[0]["MustBuyAmount"].ToString();
                rd.config.Agreement     = ds.Tables[0].Rows[0]["Agreement"].ToString();
                rd.config.CustomerId    = ds.Tables[0].Rows[0]["CustomerId"].ToString();
            }
            var rsp = new SuccessResponse <VipMultiLevelSalerConfigRP>(rd);

            return(rsp.ToJSON());
        }