using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ObjectModel.Config
{
    /// <summary>
    /// 苹果充值订单数据库对象
    /// </summary>
    public class IosPayDB
    {
        public int id;
        public int userid;
        /// <summary>
        /// 产品id
        /// </summary>
        public string productId;
        /// <summary>
        /// 订单号
        /// </summary>
        public string transactionId;
        public DateTime createTime;

        public IosPayDB() { }

        public static string GetInsertSql(int userid, string productId, string transactionId)
        {
            return $"INSERT INTO [tbIosPay]([userid], [productId], [transactionId]) VALUES ( {userid}, '{productId}', '{transactionId}')";
        }

        public string GetSaveSql()
        {
            return $"INSERT INTO [tbIosPay]([userid], [productId], [transactionId]) VALUES ( {userid}, '{productId}', '{transactionId}')";
        }

        public IosPayDB(DataRow row)
        {
            this.id = Convert.ToInt32(row["id"]);
            this.userid = Convert.ToInt32(row["userid"]);
            this.productId = row["productId"].ToString();
            this.transactionId = row["transactionId"].ToString();
        }

        /*  public UserWarDataModel(DataRow row)
        {
            this.UserId = (int)row["userId"];
            this.GameId = (int)row["gameId"];
            this.WinCount = (int)row["winCount"];
            this.LoseCount = (int)row["loseCount"];
            this.GameTotal = (int)row["gameTotal"];
            this.ExcepCount = 0;
        }*/
    }
}
