本文共 3283 字,大约阅读时间需要 10 分钟。
1: ///
2: /// 表接口 IProductInList(产品入库)。
3: ///
4: public partial interface IProductInList
5: {
6: ///
7: /// 根据入库票据号查询入库明细。
8: ///
9: /// 入库票据号。
10: void GetProductInList(string billCode);
11:
12: ///
13: /// 根据入库时间及拼音简码查询入库明细。
14: ///
15: /// 开始时间。
16: /// 结束时间。
17: /// 拼音简码。
18: void GetProductInList(DateTime startTime,DateTime endTime,string pyCode);
19: }
1: public void GetProductInList(DateTime startTime, DateTime endTime, string pyCode)
2: {
3: Condition condition = this.CreateCondition();
4:
5: if (!startTime.Equals(endTime))
6: {
7: Listtimes = new List (2);
8: times.Add(startTime);
9: times.Add(endTime);
10:
11: condition.AddElement("InTime", times, ElementType.BetWeen);
12: }
13:
14: if (pyCode.Length > 0)
15: condition.AddElement("SqlText", "CODE in (select CODE from dbo.PRODUCT where PYCODE like '" + pyCode + "%')", ElementType.SqlCondition);
16:
17: this.Query(condition);
18: }
1: private void btnSearch_Click(object sender, EventArgs e)
2: {
3: //加载报表
4:
5: if (this.reportViewer.SourceRdl==null)
6: {
7: System.IO.TextReader textReader = null;
8: try
9: {
10: string fileName = Path.Combine(Application.StartupPath, "Reports\\商品入库查询报表.rdl");
11: textReader = new System.IO.StreamReader(fileName);
12: this.reportViewer.SourceRdl = textReader.ReadToEnd();
13: }
14: finally
15: {
16: if (textReader != null)
17: textReader.Close();
18: }
19: }
20:
21: //处理数据
22: IProductInList table = DALHelper.DALManager.CreateProductInList();
23: table.GetProductInList(this.dtpStartTime.Value,this.dtpEndTime.Value, this.tbSearch.Text);
24: this.reportViewer.DataObject = table;
25: }
转载地址:http://cymra.baihongyu.com/