datatable和list的遍历
来源:互联网 发布:数控法拉克系统编程 编辑:程序博客网 时间:2024/06/01 08:35
private void PageInit()
{
string SAPOrderNo = Request["SAPOrderNo"].ToString();
List<Model.SAPOrderStatus> lst = biz.GetOrderProductInfo(SAPOrderNo);
//DataTable dt = new DataTable();
//dt = biz.GetOrderProductInfoT(SAPOrderNo);
//if (dt.Rows.Count > 0)
//{
// double OrderQuantity = 0, DeliveryQuantity = 0, GoodsIssueQt = 0, InvoiceQuantity = 0, BackOrderQuantity = 0;
// for (int i = 0; i < dt.Rows.Count; i++)
// {
// OrderQuantity += Convert.ToDouble(dt.Rows[i]["OrderQuantity"]);
// DeliveryQuantity += Convert.ToDouble(dt.Rows[i]["DeliveryQuantity"]);
// GoodsIssueQt += Convert.ToDouble(dt.Rows[i]["GoodsIssueQt"]);
// InvoiceQuantity += Convert.ToDouble(dt.Rows[i]["InvoiceQuantity"]);
// BackOrderQuantity += Convert.ToDouble(dt.Rows[i]["BackOrderQuantity"]);
// }
// txtOrderQuantity.Text = OrderQuantity.ToString();
// txtDeliveryQuantity.Text = DeliveryQuantity.ToString();
// txtGoodsIssueQt.Text = GoodsIssueQt.ToString();
// txtInvoiceQuantity.Text = InvoiceQuantity.ToString();
// txtBackOrderQuantity.Text = BackOrderQuantity.ToString();
//}
//if (dt.Rows.Count > 0)
//{
// txtTotalRocords.Text = dt.Rows.Count.ToString();
//}
if (lst.Count > 0)
{
double OrderQuantity = 0, DeliveryQuantity = 0, GoodsIssueQt = 0, InvoiceQuantity = 0, BackOrderQuantity = 0;
for (int i = 0; i < lst.Count; i++)
{
OrderQuantity += Convert.ToDouble(lst[i].OrderQuantity);
DeliveryQuantity += Convert.ToDouble(lst[i].DeliveryQuantity);
GoodsIssueQt += Convert.ToDouble(lst[i].GoodsIssueQt);
InvoiceQuantity += Convert.ToDouble(lst[i].InvoiceQuantity);
BackOrderQuantity += Convert.ToDouble(lst[i].BackOrderQuantity);
}
txtOrderQuantity.Text = OrderQuantity.ToString();
txtDeliveryQuantity.Text = DeliveryQuantity.ToString();
txtGoodsIssueQt.Text = GoodsIssueQt.ToString();
txtInvoiceQuantity.Text = InvoiceQuantity.ToString();
txtBackOrderQuantity.Text = BackOrderQuantity.ToString();
}
txtTotalRocords.Text = lst.Count.ToString();
this.rptOrderProInfoList.DataSource = lst;
this.rptOrderProInfoList.DataBind();
}
}
{
string SAPOrderNo = Request["SAPOrderNo"].ToString();
List<Model.SAPOrderStatus> lst = biz.GetOrderProductInfo(SAPOrderNo);
//DataTable dt = new DataTable();
//dt = biz.GetOrderProductInfoT(SAPOrderNo);
//if (dt.Rows.Count > 0)
//{
// double OrderQuantity = 0, DeliveryQuantity = 0, GoodsIssueQt = 0, InvoiceQuantity = 0, BackOrderQuantity = 0;
// for (int i = 0; i < dt.Rows.Count; i++)
// {
// OrderQuantity += Convert.ToDouble(dt.Rows[i]["OrderQuantity"]);
// DeliveryQuantity += Convert.ToDouble(dt.Rows[i]["DeliveryQuantity"]);
// GoodsIssueQt += Convert.ToDouble(dt.Rows[i]["GoodsIssueQt"]);
// InvoiceQuantity += Convert.ToDouble(dt.Rows[i]["InvoiceQuantity"]);
// BackOrderQuantity += Convert.ToDouble(dt.Rows[i]["BackOrderQuantity"]);
// }
// txtOrderQuantity.Text = OrderQuantity.ToString();
// txtDeliveryQuantity.Text = DeliveryQuantity.ToString();
// txtGoodsIssueQt.Text = GoodsIssueQt.ToString();
// txtInvoiceQuantity.Text = InvoiceQuantity.ToString();
// txtBackOrderQuantity.Text = BackOrderQuantity.ToString();
//}
//if (dt.Rows.Count > 0)
//{
// txtTotalRocords.Text = dt.Rows.Count.ToString();
//}
if (lst.Count > 0)
{
double OrderQuantity = 0, DeliveryQuantity = 0, GoodsIssueQt = 0, InvoiceQuantity = 0, BackOrderQuantity = 0;
for (int i = 0; i < lst.Count; i++)
{
OrderQuantity += Convert.ToDouble(lst[i].OrderQuantity);
DeliveryQuantity += Convert.ToDouble(lst[i].DeliveryQuantity);
GoodsIssueQt += Convert.ToDouble(lst[i].GoodsIssueQt);
InvoiceQuantity += Convert.ToDouble(lst[i].InvoiceQuantity);
BackOrderQuantity += Convert.ToDouble(lst[i].BackOrderQuantity);
}
txtOrderQuantity.Text = OrderQuantity.ToString();
txtDeliveryQuantity.Text = DeliveryQuantity.ToString();
txtGoodsIssueQt.Text = GoodsIssueQt.ToString();
txtInvoiceQuantity.Text = InvoiceQuantity.ToString();
txtBackOrderQuantity.Text = BackOrderQuantity.ToString();
}
txtTotalRocords.Text = lst.Count.ToString();
this.rptOrderProInfoList.DataSource = lst;
this.rptOrderProInfoList.DataBind();
}
}
- datatable和list的遍历
- DataTable 和List之间的转换
- list和datatable的相互转化
- 完整的DataTable和list转换
- datatable和list互换
- List和DataTable
- DataTable和list转换
- List 和 Map 的遍历
- 遍历datatable的方法
- 遍历datatable的方法
- 遍历datatable的方法
- 完整的DataTable和list转换 老外写的
- 完整的DataTable和list转换 老外写的 .
- DataTable 和List 相互转换
- DataTable 和List 相互转换
- DataTable 和List 相互转换
- DataTable 和List 相互转换
- DataTable 和List 相互转换
- Objective-C语法之NSSet和NSMutableSet
- hdu 4612Warm up
- Lucene 4.4简单搜索测试
- IOS深入学习(12)之Archiving
- Minigui3.0.12移植到nuc951上
- datatable和list的遍历
- qtp检查点
- Practical ATL: Understanding the class object
- JAVA学习脚印10:解惑java 中UTF-16与char
- 湖南生第八届大学生程序设计大赛原题 C-Updating a Dictionary(UVA12504 - Updating a Dictionary)
- 程序设计之Java设计模式(单例模式)
- linux内核调试方法总结
- 利用jstl标签实现web项目的国际化
- 获取Android设备的CPU频率