using System;
using System.Data;
using SK.MemberDAL;

namespace SK.MemberBLL
{
	/// <summary>
	/// ExpendSystem 的摘要说明。
	/// </summary>
	public class ExpendSystem
	{
		Expend expend = new Expend();
		public ExpendSystem()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public DataSet List(object MemberID)
		{
			DataTable dt = expend.List(MemberID).Tables[0];
			DataTable expendTable = new DataTable();
			expendTable.Columns.Add("ExpendTime",System.Type.GetType("System.DateTime"));
			expendTable.Columns.Add("InPoint",System.Type.GetType("System.Int32"));
			expendTable.Columns.Add("OutPoint",System.Type.GetType("System.Int32"));
			expendTable.Columns.Add("RemainPoint",System.Type.GetType("System.Int32"));
			expendTable.Columns.Add("Remark",System.Type.GetType("System.String"));
			DataRow myRow;
			foreach(DataRow dr in dt.Rows)
			{
				myRow = expendTable.NewRow(); 
				myRow["ExpendTime"] = dr["ExpendTime"]; 
				myRow["Remark"] = dr["Remark"];
				myRow["RemainPoint"] = dr["RemainPoint"]; 
				if(dr["TypeID"].ToString()=="0")
					myRow["OutPoint"] = dr["ExpendPoint"]; 
				else
					myRow["InPoint"] = dr["ExpendPoint"]; 
				expendTable.Rows.Add(myRow);
			}
			DataSet ds = new DataSet();
			ds.Tables.Add(expendTable);
			return ds;
		}
	}
	
}
