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();
}
}