コード例 #1
0
        /// <summary>
        /// 添加优惠券操作日志
        /// </summary>
        /// <param name="logModel">The log model.</param>
        /// <returns>true if XXXX, false otherwise.</returns>
        public bool AddCouponLog(LogBaseModel logModel)
        {
            string strSql = @"insert into BM_CouponLog(UserId,ShopId,BelongShopId,Type,Money,CouponId) values(@UserId,@ShopId,@BelongShopId,@Type,@Money,@CouponId)";
            var    param  = new[] {
                new SqlParameter("@UserId", logModel.UserId),
                new SqlParameter("@ShopId", logModel.ShopId),
                new SqlParameter("@BelongShopId", logModel.BelongShopId),
                new SqlParameter("@Type", logModel.OperationType),
                new SqlParameter("@Money", logModel.Money),
                new SqlParameter("@CouponId", logModel.objId)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param) > 0);
        }
コード例 #2
0
        /// <summary>
        /// 添加客户操作日志
        /// </summary>
        /// <param name="logModel">The log model.</param>
        /// <returns>true if XXXX, false otherwise.</returns>
        public bool AddCustomerLog(LogBaseModel logModel)
        {
            string strSql = @"insert into BM_CustomerLog(UserId,ShopId,AppSystem,BelongShopId,OperationType,customerId) values(@UserId,@ShopId,@AppSystem,@BelongShopId,@OperationType,@customerId)";
            var    param  = new[] {
                new SqlParameter("@UserId", logModel.UserId),
                new SqlParameter("@ShopId", logModel.ShopId),
                new SqlParameter("@AppSystem", logModel.AppSystem),
                new SqlParameter("@BelongShopId", logModel.BelongShopId),
                new SqlParameter("@OperationType", logModel.OperationType),
                new SqlParameter("@customerId", logModel.objId)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param) > 0);
        }
コード例 #3
0
ファイル: LogLogic.cs プロジェクト: huangliliu0917/BMeng
        /// <summary>
        /// 添加优惠券操作日志
        /// </summary>
        /// <param name="logModel">The log model.</param>
        /// <returns>true if XXXX, false otherwise.</returns>
        public static bool AddCouponLog(LogBaseModel logModel)
        {
            using (var dal = FactoryDispatcher.LogFactory())
            {
                if (logModel.UserId > 0)
                {
                    int shopId = ShopLogic.GetBelongShopId(logModel.ShopId);
                    if (shopId > 0)
                    {
                        logModel.BelongShopId = shopId;
                    }
                    else
                    {
                        logModel.BelongShopId = logModel.ShopId;
                    }

                    return(dal.AddCouponLog(logModel));
                }
                else
                {
                    return(false);
                }
            }
        }