Exemplo n.º 1
0
        private int Novel(Novel novelInfo)
        {
            int result = (int)ErrorMessage.失败;

            if (!novelInfo.IsNullOrEmpty <Novel>() && novelInfo.Id > 0 &&
                (novelInfo.FeeType == (int)Constants.Novel.FeeType.novel || novelInfo.FeeType == (int)Constants.Novel.FeeType.novelchapter))
            {
                int            fee   = novelInfo.Fee;
                NovelOrderInfo model = new NovelOrderInfo();
                model                  = GetLogInfo(model) as NovelOrderInfo;
                model.NovelId          = NovelId;
                model.UserName         = currentUser.UserName;
                model.FeeType          = 0;
                model.Fee              = fee;
                model.Cash             = fee;
                model.Status           = 1;
                model.OrderTime        = DateTime.Now;
                model.Balance          = 0;
                model.BindFee          = 0;
                model.FeeId            = 0;
                model.Integral         = 0;
                model.NovelName        = "";
                model.OrderCode        = "";;
                model.PayChannel       = 0;
                model.Rebate           = 0;
                model.RebateExpression = "";
                model.RebateFee        = 0;
                model.WordSize         = 0;
                result                 = _orderService.OrderNovel(model);
            }

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 按本订购
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int OrderNovel(NovelOrderInfo model)
        {
            if (model == null)
            {
                return(0);
            }

            using (var conn = DbConnection(DbOperation.Write))
            {
                var repo = new Repository.OrderRepo(conn);
                return(repo.OrderNovel(model));
            }
        }
Exemplo n.º 3
0
        private int OrderNovel(NovelOrderInfo model, int clientType)
        {
            string spName = "Users.Novel_Order";

            var p = new DynamicParameters();

            p.Add("@NovelId", model.NovelId);
            p.Add("@NovelName", model.NovelName);
            p.Add("@Fee", model.Fee);
            p.Add("@OrderTime", model.OrderTime);
            p.Add("@Status", model.Status);
            p.Add("@PayChannel", model.PayChannel);
            p.Add("@OrderCode", model.OrderCode);
            p.Add("@Rebate", model.Rebate);
            p.Add("@RebateFee", model.RebateFee);
            p.Add("@FeeId", model.FeeId);
            p.Add("@Balance", model.Balance);
            p.Add("@BindFee", model.BindFee);
            p.Add("@Cash", model.Cash);
            p.Add("@Integral", model.Integral);
            p.Add("@RebateExpression", model.RebateExpression);
            p.Add("@UserId", model.UserId);
            p.Add("@UserName", model.UserName);
            p.Add("@ClientId", model.ClientId);
            p.Add("@Version", model.Version);
            p.Add("@UserAgent", model.UserAgent);
            p.Add("@IMEI", model.IMEI);
            p.Add("@IMSI", model.IMSI);
            p.Add("@ChannelId", model.ChannelId);
            p.Add("@SourceType", model.SourceType);
            p.Add("@Mobile", model.Mobile);
            p.Add("@NetType", model.NetType);
            p.Add("@Province", model.Province);
            p.Add("@City", model.City);
            p.Add("@ReferUrl", model.ReferUrl);
            p.Add("@IPAddress", model.IPAddress);
            p.Add("@RemoteHost", model.RemoteHost);
            p.Add("@WordSize", model.WordSize);
            p.Add("@FeeType", model.FeeType);
            p.Add("@ClientType", clientType);
            p.Add("@ROut", dbType: DbType.Int32, direction: ParameterDirection.Output);

            DbManage.Execute(spName, p, CommandType.StoredProcedure);

            return(p.Get <int>("@ROut"));
        }
Exemplo n.º 4
0
 /// <summary>
 /// 按本订购
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int OrderNovel(NovelOrderInfo model)
 {
     return(OrderNovel(model, 0));
 }