private void LoadInformation(int id) { PurchaseOrder oc = ControllerManager.PurchaseOrder.GetById(id); IList <PurchaseOrderItem> ocList = ControllerManager.PurchaseOrderItem.GetPurchaseOrderItemList(oc); IList <PurchaseOrderItemInformation> poiinfo = new List <PurchaseOrderItemInformation>(); foreach (PurchaseOrderItem item in ocList) { Grundfos.ScalaConnector.Product prodscala = Grundfos.ScalaConnector.ControllerManager.Product.GetProductInfo(item.Product.ProductCode); PurchaseOrderItemInformation temp = new PurchaseOrderItemInformation(); temp.Id = item.Id; temp.ProductName = item.Product.Description; temp.Quantity = item.Quantity; temp.Price = prodscala.PurchasePrice; temp.TotalPrice = temp.Price * temp.Quantity; temp.Stock = prodscala.StockQ; temp.ProductCode = item.Product.ProductCode; temp.Status = Convert.ToInt32(item.PurchaseOrderItemStatus); temp.QuantitySuggested = item.QuantitySuggested; poiinfo.Add(temp); } Label1.Text = id.ToString(); repItems.DataSource = poiinfo; repItems.DataBind(); //GridView1.DataSource = poiinfo; //GridView1.DataBind(); }
private void LoadInformation(int id, int pos) { PurchaseOrder oc = ControllerManager.PurchaseOrder.GetById(id); switch (oc.WOD) { case WayOfDelivery.Maritimo: rblWOD.SelectedValue = "1"; break; case WayOfDelivery.Aereo: rblWOD.SelectedValue = "2"; break; case WayOfDelivery.Courrier: rblWOD.SelectedValue = "3"; break; } IList <PurchaseOrderItem> ocList = ControllerManager.PurchaseOrderItem.GetPurchaseOrderItemList(oc); IList <PurchaseOrderItemInformation> poiinfo = new List <PurchaseOrderItemInformation>(); foreach (PurchaseOrderItem item in ocList) { Grundfos.ScalaConnector.Product prodscala = Grundfos.ScalaConnector.ControllerManager.Product.GetProductInfo(item.Product.ProductCode); PurchaseOrderItemInformation temp = new PurchaseOrderItemInformation(); temp.Id = item.Id; temp.ProductName = item.Product.Description; temp.Quantity = item.Quantity; temp.Price = prodscala.PurchasePrice; temp.TotalPrice = temp.Price * temp.Quantity; temp.Stock = prodscala.StockQ; temp.ProductCode = item.Product.ProductCode; temp.Status = Convert.ToInt32(item.PurchaseOrderItemStatus); temp.QuantitySuggested = item.QuantitySuggested; switch (prodscala.PurchaseCurrency) { case "00": temp.Currency = "$"; break; case "01": temp.Currency = "U$S"; break; case "02": temp.Currency = "€"; break; } poiinfo.Add(temp); } Label1.Text = id.ToString(); Label3.Text = pos.ToString(); repItems.DataSource = poiinfo; repItems.DataBind(); }