/// <summary>
        /// 更新一条记录(异步方式)
        /// </summary>
        /// <param name="entity">实体模型</param>
        /// <returns></returns>
        public virtual async Task <bool> UpdateAsync(PaymentLogEntity entity)
        {
            Dictionary <string, object> dict = new Dictionary <string, object>();

            GetParameters(entity, dict);
            string strSQL = "Update PaymentLog SET " +
                            "UserName = @UserName," +
                            "OrderID = @OrderID," +
                            "PaymentNum = @PaymentNum," +
                            "PlatformID = @PlatformID," +
                            "MoneyPay = @MoneyPay," +
                            "MoneyTrue = @MoneyTrue," +
                            "PayTime = @PayTime," +
                            "SuccessTime = @SuccessTime," +
                            "Status = @Status," +
                            "PlatformInfo = @PlatformInfo," +
                            "Remark = @Remark," +
                            "Exp = @Exp," +
                            "Point = @Point," +
                            "ValidDate = @ValidDate," +
                            "GroupID = @GroupID" +
                            " WHERE " +

                            "PaymentLogID = @PaymentLogID";

            return(await Task.Run(() => _DB.ExeSQLResult(strSQL, dict)));
        }
        /// <summary>
        /// 增加一条记录,返回新的ID号。需要有一个单一主键,并且开启有标识符属性(异步方式)
        /// </summary>
        /// <param name="entity">实体模型</param>
        /// <returns></returns>
        public virtual async Task <int> InsertAsync(PaymentLogEntity entity)
        {
            if (entity.PaymentLogID <= 0)
            {
                entity.PaymentLogID = GetNewID();
            }
            Dictionary <string, object> dict = new Dictionary <string, object>();

            GetParameters(entity, dict);

            string strSQL = "insert into PaymentLog (" +
                            "PaymentLogID," +
                            "UserName," +
                            "OrderID," +
                            "PaymentNum," +
                            "PlatformID," +
                            "MoneyPay," +
                            "MoneyTrue," +
                            "PayTime," +
                            "SuccessTime," +
                            "Status," +
                            "PlatformInfo," +
                            "Remark," +
                            "Exp," +
                            "Point," +
                            "ValidDate," +
                            "GroupID) " +
                            "values(" +
                            "@PaymentLogID," +
                            "@UserName," +
                            "@OrderID," +
                            "@PaymentNum," +
                            "@PlatformID," +
                            "@MoneyPay," +
                            "@MoneyTrue," +
                            "@PayTime," +
                            "@SuccessTime," +
                            "@Status," +
                            "@PlatformInfo," +
                            "@Remark," +
                            "@Exp," +
                            "@Point," +
                            "@ValidDate," +
                            "@GroupID)";

            if (await Task.Run(() => _DB.ExeSQLResult(strSQL, dict)))
            {
                return(DataConverter.CLng(entity.PaymentLogID));
            }
            return(-1);
        }
        /// <summary>
        /// 获取实体(异步方式)
        /// </summary>
        /// <param name="strWhere">参数化查询条件(例如: and Name = @Name )</param>
        /// <param name="dict">参数的名/值集合</param>
        /// <returns></returns>
        public virtual async Task <PaymentLogEntity> GetEntityAsync(string strWhere, Dictionary <string, object> dict = null)
        {
            PaymentLogEntity obj    = null;
            string           strSQL = "select top 1 * from PaymentLog where 1=1 " + strWhere;

            using (NullableDataReader reader = await Task.Run(() => _DB.GetDataReader(strSQL, dict)))
            {
                if (reader.Read())
                {
                    obj = GetEntityFromrdr(reader);
                }
            }
            return(obj);
        }
        /// <summary>
        /// 增加一条记录
        /// </summary>
        /// <param name="entity">实体模型</param>
        /// <returns></returns>
        public virtual bool Add(PaymentLogEntity entity)
        {
            if (entity.PaymentLogID <= 0)
            {
                entity.PaymentLogID = GetNewID();
            }
            Dictionary <string, object> dict = new Dictionary <string, object>();

            GetParameters(entity, dict);

            string strSQL = "insert into PaymentLog (" +
                            "PaymentLogID," +
                            "UserName," +
                            "OrderID," +
                            "PaymentNum," +
                            "PlatformID," +
                            "MoneyPay," +
                            "MoneyTrue," +
                            "PayTime," +
                            "SuccessTime," +
                            "Status," +
                            "PlatformInfo," +
                            "Remark," +
                            "Exp," +
                            "Point," +
                            "ValidDate," +
                            "GroupID) " +
                            "values(" +
                            "@PaymentLogID," +
                            "@UserName," +
                            "@OrderID," +
                            "@PaymentNum," +
                            "@PlatformID," +
                            "@MoneyPay," +
                            "@MoneyTrue," +
                            "@PayTime," +
                            "@SuccessTime," +
                            "@Status," +
                            "@PlatformInfo," +
                            "@Remark," +
                            "@Exp," +
                            "@Point," +
                            "@ValidDate," +
                            "@GroupID)";

            return(_DB.ExeSQLResult(strSQL, dict));
        }
 /// <summary>
 /// 把实体类转换成键/值对集合
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="dict"></param>
 private static void GetParameters(PaymentLogEntity entity, Dictionary <string, object> dict)
 {
     dict.Add("PaymentLogID", entity.PaymentLogID);
     dict.Add("UserName", entity.UserName);
     dict.Add("OrderID", entity.OrderID);
     dict.Add("PaymentNum", entity.PaymentNum);
     dict.Add("PlatformID", entity.PlatformID);
     dict.Add("MoneyPay", entity.MoneyPay);
     dict.Add("MoneyTrue", entity.MoneyTrue);
     dict.Add("PayTime", entity.PayTime);
     dict.Add("SuccessTime", entity.SuccessTime);
     dict.Add("Status", entity.Status);
     dict.Add("PlatformInfo", entity.PlatformInfo);
     dict.Add("Remark", entity.Remark);
     dict.Add("Exp", entity.Exp);
     dict.Add("Point", entity.Point);
     dict.Add("ValidDate", entity.ValidDate);
     dict.Add("GroupID", entity.GroupID);
 }
        /// <summary>
        /// 通过数据读取器生成实体类
        /// </summary>
        /// <param name="rdr"></param>
        /// <returns></returns>
        private static PaymentLogEntity GetEntityFromrdr(NullableDataReader rdr)
        {
            PaymentLogEntity info = new PaymentLogEntity();

            info.PaymentLogID = rdr.GetInt32("PaymentLogID");
            info.UserName     = rdr.GetString("UserName");
            info.OrderID      = rdr.GetInt32("OrderID");
            info.PaymentNum   = rdr.GetString("PaymentNum");
            info.PlatformID   = rdr.GetInt32("PlatformID");
            info.MoneyPay     = rdr.GetDecimal("MoneyPay");
            info.MoneyTrue    = rdr.GetDecimal("MoneyTrue");
            info.PayTime      = rdr.GetNullableDateTime("PayTime");
            info.SuccessTime  = rdr.GetNullableDateTime("SuccessTime");
            info.Status       = rdr.GetInt32("Status");
            info.PlatformInfo = rdr.GetString("PlatformInfo");
            info.Remark       = rdr.GetString("Remark");
            info.Exp          = rdr.GetInt32("Exp");
            info.Point        = rdr.GetInt32("Point");
            info.ValidDate    = rdr.GetInt32("ValidDate");
            info.GroupID      = rdr.GetInt32("GroupID");
            return(info);
        }
 /// <summary>
 /// 增加或更新一条记录(异步方式)
 /// </summary>
 /// <param name="entity">实体模型</param>
 /// <param name="IsSave">是否增加</param>
 /// <returns></returns>
 public virtual async Task <bool> AddOrUpdateAsync(PaymentLogEntity entity, bool IsSave)
 {
     return(IsSave ? await AddAsync(entity) : await UpdateAsync(entity));
 }
 /// <summary>
 /// 增加或更新一条记录
 /// </summary>
 /// <param name="entity">实体模型</param>
 /// <param name="IsSave">是否增加</param>
 /// <returns></returns>
 public virtual bool AddOrUpdate(PaymentLogEntity entity, bool IsSave)
 {
     return(IsSave ? Add(entity) : Update(entity));
 }