protected void dlAssetOrders_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView drv = (DataRowView)e.Item.DataItem; LinkButton lnkOrderId = (LinkButton)e.Item.FindControl("lnkOrderId"); lnkOrderId.Text = drv["OrderId"].ToString(); lnkOrderId.CommandArgument = drv["OrderId"].ToString(); Label lblRequestId = (Label)e.Item.FindControl("lblRequestId"); lblRequestId.Text = "CVT" + drv["RequestId"].ToString(); Label lblNickName = (Label)e.Item.FindControl("lblNickName"); lblNickName.Text = drv["NickName"].ToString(); Label lblModel = (Label)e.Item.FindControl("lblModel"); lblModel.Text = drv["ModelName"].ToString(); Label lblOrderType = (Label)e.Item.FindControl("lblOrderType"); lblOrderType.Text = drv["OrderTypeName"].ToString(); Label lblQuantityRequested = (Label)e.Item.FindControl("lblQuantityRequested"); lblQuantityRequested.Text = drv["RequestedQuantity"].ToString(); //Label lblQuantityProcure = (Label)e.Item.FindControl("lblQuantityProcure"); //lblQuantityProcure.Text = drv["ProcureQuantity"].ToString(); //Label lblQuantityReDeploy = (Label)e.Item.FindControl("lblQuantityReDeploy"); //lblQuantityReDeploy.Text = drv["ReDeployQuantity"].ToString(); //Label lblQuantityReturned = (Label)e.Item.FindControl("lblQuantityReturned"); //lblQuantityReturned.Text = drv["ReturnedQuantity"].ToString(); Label lblLocation = (Label)e.Item.FindControl("lblLocation"); lblLocation.Text = drv["Location"].ToString(); Label lblClass = (Label)e.Item.FindControl("lblClass"); lblClass.Text = drv["Class"].ToString(); Label lblEnvironment = (Label)e.Item.FindControl("lblEnvironment"); lblEnvironment.Text = drv["Environment"].ToString(); //Label lblPurchaseOrderStatus = (Label)e.Item.FindControl("lblPurchaseOrderStatus"); //lblPurchaseOrderStatus.Text = drv["PurchaseOrderStatus"].ToString(); //Label lblVendorOrderStatus = (Label)e.Item.FindControl("lblVendorOrderStatus"); //lblVendorOrderStatus.Text = drv["VendorOrderStatus"].ToString(); Label lblSubmittedDate = (Label)e.Item.FindControl("lblSubmittedDate"); lblSubmittedDate.Text = DateTime.Parse(drv["created"].ToString()).ToShortDateString(); Label lblStatus = (Label)e.Item.FindControl("lblStatus"); lblStatus.Text = drv["OrderStatus"].ToString(); Label lblLastUpdates = (Label)e.Item.FindControl("lblLastUpdates"); lblLastUpdates.Text = ""; DataSet dsRR = oAssetOrder.GetAssetOrderResourceRequestsByRequest(Int32.Parse(drv["RequestId"].ToString()), Int32.Parse(drv["Number"].ToString())); dsRR.Tables[0].DefaultView.Sort = "RRModified Desc "; DataTable dtRR = dsRR.Tables[0].DefaultView.ToTable(); if (dtRR.Rows.Count > 0) { lblLastUpdates.Text = dtRR.Rows[0]["RRName"].ToString() + "<br/>" + DateTime.Parse(dtRR.Rows[0]["RRModified"].ToString()).ToShortDateString(); } } }