示例#1
0
        /// <summary>
        /// 更新充值日志
        /// </summary>
        /// <param name="model"></param>
        /// <returns>返回受影响行</returns>
        /// <remarks>2017-03-31 杨浩 创建</remarks>
        public override int Update(CrQianDaiVipCardRechargeLog model)
        {
            int rowsAffected = Context.Update <CrQianDaiVipCardRechargeLog>("CrQianDaiVipCardRechargeLog", model)
                               .AutoMap(x => x.SysNo, x => x.CreateDate, x => x.CreatedBy, x => x.CardId)
                               .Where(x => x.SysNo)
                               .Execute();

            return(rowsAffected);
        }
示例#2
0
        /// <summary>
        /// 会员卡充值
        /// </summary>
        /// <param name="rechargeNo">充值流水号</param>
        /// <param name="cardId">会员卡号</param>
        /// <param name="money">充值金额</param>
        /// <returns></returns>
        /// <remarks>2017-02-08 杨浩 创建</remarks>
        public override Result VipCardRecharge(string rechargeNo, int cardId, decimal money)
        {
            var result    = base.VipCardRechargeResult(rechargeNo);
            var sParaTemp = new SortedDictionary <string, string>();

            sParaTemp.Add("partner_id", config.Partner);
            sParaTemp.Add("charset_name", config.Charset_name.ToLower());
            sParaTemp.Add("sign_type", config.Sign_type);

            sParaTemp.Add("recharge_no", rechargeNo);
            sParaTemp.Add("card_id", cardId.ToString());
            sParaTemp.Add("money", money.ToString());
            sParaTemp.Add("notify_url", "http://xrc.com/QianDaiVipCard/VipCardRechargeNotify");

            string responsestr = new Submit().BuildRequest(sParaTemp, "vipCard/recharge");

            if (responsestr.StartsWith("报错:"))
            {
                result.StatusCode = 1;
                result.Message    = responsestr;
                return(result);
            }

            var back = JObject.Parse(responsestr);

            if (back["ret_code"].ToString() != "0")
            {
                result.StatusCode = 3;
                result.Message    = back["ret_message"].ToString() + "-" + money.ToString();
            }
            else
            {
                var qianDaiVipCardRechargeLog = new CrQianDaiVipCardRechargeLog()
                {
                    RechargeNo = rechargeNo,
                    CardId     = cardId,
                    Money      = money,
                    CreateDate = DateTime.Now,
                    CreatedBy  = BLL.Authentication.AdminAuthenticationBo.Instance.Current.Base.SysNo,
                    Status     = "-2",
                };

                QianDaiVipCardRechargeLogBo.Instance.CreateCrQianDaiVipCardRechargeLog(qianDaiVipCardRechargeLog);
            }

            return(result);
        }
 /// <summary>
 /// 更新充值日志
 /// </summary>
 /// <param name="model"></param>
 /// <returns>返回受影响行</returns>
 /// <remarks>2017-03-31 杨浩 创建</remarks>
 public abstract int Update(CrQianDaiVipCardRechargeLog model);
 /// <summary>
 /// 创建
 /// </summary>
 /// <returns>会员信息</returns>
 /// <remarks>2017-03-31 杨浩 创建</remarks>
 public abstract CrQianDaiVipCardRechargeLog CreateCrQianDaiVipCardRechargeLog(CrQianDaiVipCardRechargeLog model);
示例#5
0
 /// <summary>
 /// 更新充值日志
 /// </summary>
 /// <param name="model"></param>
 /// <returns>返回受影响行</returns>
 /// <remarks>2017-03-31 杨浩 创建</remarks>
 public int Update(CrQianDaiVipCardRechargeLog model)
 {
     return(ICrQianDaiVipCardRechargeLogDao.Instance.Update(model));
 }
示例#6
0
 /// <summary>
 /// 创建
 /// </summary>
 /// <returns>会员信息</returns>
 /// <remarks>2017-03-31 杨浩 创建</remarks>
 public CrQianDaiVipCardRechargeLog CreateCrQianDaiVipCardRechargeLog(CrQianDaiVipCardRechargeLog model)
 {
     return(ICrQianDaiVipCardRechargeLogDao.Instance.CreateCrQianDaiVipCardRechargeLog(model));
 }
示例#7
0
 /// <summary>
 /// 创建
 /// </summary>
 /// <returns>会员信息</returns>
 /// <remarks>2017-03-31 杨浩 创建</remarks>
 public override CrQianDaiVipCardRechargeLog CreateCrQianDaiVipCardRechargeLog(CrQianDaiVipCardRechargeLog model)
 {
     model.SysNo = Context.Insert <CrQianDaiVipCardRechargeLog>("CrQianDaiVipCardRechargeLog", model)
                   .AutoMap(x => x.SysNo)
                   .ExecuteReturnLastId <int>("SysNo");
     return(model);
 }