因为发布了上篇“在线支付平台间交易对账之我见”,看到大家的评论,我这才发现文章没有完成,具体的就aspx部分还尚未实现。下面就对账部分的aspx部分的实现做说明,毕竟因为财务的同事在去对账的时候,不会去执行sp的,执行sp这个好像只有技术才会做的事情。
首先我们的页面会这样设计:
然后再选择开始日期,结束日期,点击查询,实现执行sp: dep_order_check,然后把执行结果反馈到页面上:
button的执行(主要)代码如下:
protected void BtnCheck_Click(object sender, EventArgs e)
{
using(SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["connstring"]))
{
SqlCommand cmd = new SqlCommand("dep_order_check", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@startdate",SqlDbType.VarChar,14);
cmd.Parameters["@startdate"].Value = TxtStartDate.Text.ToString(); //TextBox_Start_Date
//......
cmd.Parameters.Add("@shopcount ",SqlDbType.Int);
cmd.Parameters["@shopcount"].Direction = ParameterDirection.Output;
//......
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(cmd);
RptList.DataSource = ds; //The ""
RptList.DataBind();
}
}
然后执行完毕,结果体现出来为:
然后,对账的同事就会发现,shop5笔,bank6笔,但是,shop掉单1笔,总体上
shop与bank交易数: 5 + 1 = 6
shop与bank交易额: 240+100=340
这里shop里的1笔100元的掉单还需要进一步的处理。这部分我会在支付平台后续的文章中介绍。
posted @ 2009-01-03 00:06
Kevin Zhou 阅读(186)
评论(4) 编辑 收藏 所属分类:
在线支付平台