using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;

namespace SK.MemberDAL
{
	/// <summary>
	/// PayLocal 的摘要说明。
	/// </summary>
	public class PayLocal
	{
		public PayLocal()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public void Add(object MemberID,object v_oid,object v_amount,object ProductID,object PayPoint,object PayMonth)
		{
			SqlParameter[] oParms =new SqlParameter[6];
			oParms[0] = new SqlParameter("@MemberID",MemberID);
			oParms[1] = new SqlParameter("@v_oid",v_oid);
			oParms[2] = new SqlParameter("@v_amount",v_amount);
			oParms[3] = new SqlParameter("@ProductID",ProductID);
			oParms[4] = new SqlParameter("@PayPoint",PayPoint);
			oParms[5] = new SqlParameter("@PayMonth",PayMonth);

			SqlHelper.ExecuteNonQuery(Data.ConnString,CommandType.Text,"insert into PayLocal(MemberID,v_oid,v_amount,ProductID,PayPoint,PayMonth,PayTime) values(@MemberID,@v_oid,@v_amount,@ProductID,@PayPoint,@PayMonth,getdate())",oParms);
		}
		public DataRow Info_v_oid(object v_oid)
		{
			SqlParameter[] oParms =new SqlParameter[1];
			oParms[0] = new SqlParameter("@v_oid",v_oid);

			using(DataSet ds = SqlHelper.ExecuteDataset(Data.ConnString,CommandType.Text,"select * from PayLocal where v_oid=@v_oid",oParms))
			{
				if(ds.Tables[0].Rows.Count>0)
					return ds.Tables[0].Rows[0];
				else
					return null;
			}
		}
	}
}
