Esempio n. 1
0
        public string GetSellerMonthRewardList(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <GetSellUserRewardListRP> >();

            var pageSize  = rp.Parameters.PageSize;
            var pageIndex = rp.Parameters.PageIndex;


            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var bll = new RetailTraderBLL(loggingSessionInfo);
            var rd  = new GetSellerMonthRewardListRD();
            var rsp = new SuccessResponse <IAPIResponseData>(rd);
            //获取分销商的信息,loggingSessionInfo.ClientID,必须要传customerID
            var ds = bll.GetSellerMonthRewardList(rp.Parameters.UnitID, rp.Parameters.SellerOrRetailName, rp.Parameters.Year,
                                                  rp.Parameters.Month, loggingSessionInfo.ClientID, loggingSessionInfo.UserID, pageIndex ?? 1, pageSize ?? 15, rp.Parameters.OrderBy, rp.Parameters.OrderType); //获取



            //判断账号是否存在
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                var tempDt = ds.Tables[1];
                rd.SellerMonthRewardList = DataTableToObject.ConvertToList <SellerMonthRewards>(tempDt);//直接根据所需要的字段反序列化
                rd.TotalCount            = Convert.ToInt32(ds.Tables[0].Rows[0]["TotalCount"].ToString());
                rd.TotalPages            = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(Convert.ToInt32(ds.Tables[0].Rows[0]["TotalCount"].ToString()) * 1.00 / (pageSize ?? 15) * 1.00)));
            }

            return(rsp.ToJSON());
        }