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

namespace ObjectModel.Config.HuaWei
{
    public class HuaWeiPayDB
    {
        public int id;
        public int userid;
        /// <summary>
        /// 产品id
        /// </summary>
        public string productId;
        /// <summary>
        /// 订单号
        /// </summary>
        public string orderId;
        public DateTime createTime;

        public HuaWeiPayDB() { }

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

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

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