/// <summary>
        /// 添加一条记录
        /// </summary>
        public int Add(TimeSaleClass entity, IDbTransaction tran)
        {
            string sql = @"insert into [TimeSaleClass]
                               ([name], [startTime], [endTime])
                               values
                               (@name, @startTime, @endTime)";

            object param = new
            {
                name = entity.Name,
                startTime = entity.StartTime,
                endTime = entity.EndTime
            };
            int count = tran.Connection.Execute(sql, param, tran);
            return count;
        }
        /// <summary>
        /// 添加一条记录
        /// </summary>
        public int Add(TimeSaleClass entity)
        {
            string sql = @"insert into [TimeSaleClass]
                               ([name], [startTime], [endTime])
                               values
                               (@name, @startTime, @endTime)";

            object param = new
            {
                name = entity.Name,
                startTime = entity.StartTime,
                endTime = entity.EndTime
            };

            using (IDbConnection conn = OpenConnection())
            {
                int count = conn.Execute(sql, param);
                return count;
            }
        }
        /// <summary>
        /// 添加一条记录
        /// </summary>
        public ResultSet Add(TimeSaleClass entity)
        {
            Func<TimeSaleClass, ResultStatus> validate = (_entity) =>
            {
                return new ResultStatus();
            };

            Func<TimeSaleClass, ResultStatus> op = (_entity) =>
            {
                int ret = new TimeSaleClassDal().Add(entity);
                if (ret > 0)
                    return new ResultStatus();
                else
                    return new ResultStatus()
                    {
                        Success = false,
                        Code = StatusCollection.AddFailed.Code,
                        Description = StatusCollection.AddFailed.Description
                    };
            };

            return HandleBusiness(entity, op, validate);
        }