Esempio n. 1
0
        public string GetVipCount15Days(string pRequest)
        {
            var rp   = pRequest.DeserializeJSONTo <APIRequest <GeneralRP> >();
            var para = rp.Parameters;
            var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, "1");

            var bll = new SysRetailRewardRuleBLL(loggingSessionInfo);
            var rd  = new VipCountRD();
            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            rd.VipCountList = DataTableToObject.ConvertToList <VipCountInfo>(bll.GetRetailTraderVipCountByDays(rp.Parameters.RetailTraderId, 15).Tables[0]).ToArray();

            var dsMain = bll.GetRetailTraderEarnings(para.RetailTraderId, "All", 0, 0);

            if (dsMain.Tables[0].Rows.Count > 0)
            {
                rd.Bonus      = Convert.ToDecimal(dsMain.Tables[0].Rows[0]["Bonus"]);
                rd.SalesMoney = Convert.ToDecimal(dsMain.Tables[0].Rows[0]["SalesMoney"]);
            }
            var dsMonth = bll.GetRetailTraderEarnings(para.RetailTraderId, "Month", 0, 0);

            if (dsMonth.Tables[0].Rows.Count > 0)
            {
                rd.Bonus_Month      = Convert.ToDecimal(dsMonth.Tables[0].Rows[0]["Bonus"]);
                rd.SalesMoney_Month = Convert.ToDecimal(dsMonth.Tables[0].Rows[0]["SalesMoney"]);
            }
            var dsDaily = bll.GetRetailTraderEarnings(para.RetailTraderId, "Daily", 0, 0);

            if (dsDaily.Tables[0].Rows.Count > 0)
            {
                rd.Bonus_Day      = Convert.ToDecimal(dsDaily.Tables[0].Rows[0]["Bonus"]);
                rd.SalesMoney_Day = Convert.ToDecimal(dsDaily.Tables[0].Rows[0]["SalesMoney"]);
            }
            return(rsp.ToJSON());
        }
Esempio n. 2
0
        public string GetRetailTraderEarnings(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <RetailTraderEarningsRP> >();

            var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, "1");

            var bll    = new SysRetailRewardRuleBLL(loggingSessionInfo);
            var rd     = new RetailTraderEarningsRD();
            var rsp    = new SuccessResponse <IAPIResponseData>(rd);
            var dsMain = bll.GetRetailTraderEarnings(rp.Parameters.RetailTraderId, rp.Parameters.Type, rp.Parameters.PageIndex, rp.Parameters.PageSize);

            if (dsMain.Tables[0].Rows.Count > 0)
            {
                rd.Bonus      = Convert.ToDecimal(dsMain.Tables[0].Rows[0]["Bonus"]);
                rd.SalesMoney = Convert.ToDecimal(dsMain.Tables[0].Rows[0]["SalesMoney"]);
            }
            if (dsMain.Tables[1].Rows.Count > 0)
            {
                rd.ItemSalesInfoList = DataTableToObject.ConvertToList <ItemSalesInfo>(dsMain.Tables[1]).ToArray();
            }

            return(rsp.ToJSON());
        }