查看交易信息
1. dal transinfo-- GetList
/// <summary>
/// 获得数据列表
/// </summary>
public DataSet GetList(string strWhere)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("select transDate,cardID,transType,transMoney,remark ");
strSql.Append(" FROM transInfo ");
if(strWhere.Trim()!="")
{
strSql.Append(" where "+strWhere);
}
return DbHelperSQL.Query(strSql.ToString());
}
2. bll- transinfo-- GetList
/// <summary>
/// 获得数据列表
/// </summary>
public DataSet GetList(string strWhere)
{
return dal.GetList(strWhere);
}
3. winf- GetTrans
!)增加卡号字段
public string CardID;
2)编写窗体load事件
private void GetTrans_Load(object sender, EventArgs e)
{
BLL.transInfo bll = new BLL.transInfo();
DataSet ds= bll.GetList(" cardID='"+ CardID + "'");
dataGridView1.AutoGenerateColumns = false;
dataGridView1.DataSource = ds.Tables[0];
}
4. winf-main-菜单
private void 查交易明细ToolStripMenuItem_Click(object sender, EventArgs e)
{
GetTrans gt = new GetTrans();
gt.CardID = CardID;
gt.ShowDialog();
}