public List<InvoiceItem> GetAllInvoiceItemsByOrderID(int orderid) { List<InvoiceItem> invoiceItems = new List<InvoiceItem>(); try { InvoiceItemData data = new InvoiceItemData(); List<QSRDataObjects.InvoiceItem> dataInvoiceItems = data.GetAllInvoiceItemsByOrderID(orderid); foreach (QSRDataObjects.InvoiceItem dataItem in dataInvoiceItems) { InvoiceItem item = new InvoiceItem(); item.ProdCode = dataItem.ProductCode; item.ProdName = dataItem.ProductName; item.ProdDesc = dataItem.ProductDescription; item.Msrp = Convert.ToDouble(dataItem.MSRP); item.Quantity = dataItem.Quantity.Value; item.Tax = dataItem.TaxAmount.Value; invoiceItems.Add(item); } } catch (Exception ex) { ErrorRoutine(ex, "InvoiceItem", "GetAllInvoiceItemsByOrderID"); } return invoiceItems; }
protected void Page_Load(object sender, EventArgs e) { if (Session["UserID"] == null) Response.Redirect("~/Login.aspx"); else { InvoiceItem ii = new InvoiceItem(); OrderItemsGrid.DataSource = ii.GetAllInvoiceItemsByOrderID(Convert.ToInt32(Request.QueryString["orderid"])); DataBind(); if (!Page.IsPostBack) { } } }