/// <summary> /// Ariel Sigo /// /// Created: /// 2017/04/29 /// /// GET: /SupplierInvoice/Details/5 /// </summary> /// <param name="id"></param> /// <returns>View of Tuple with Supplier Invoice Details</returns> public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var supplierInvoice = invMgr.RetrieveAllSupplierInvoices().Find(i => i.SupplierInvoiceId == (int)id); var invoiceDetails = invMgr.RetrieveSupplierInvoiceLinesByInvoiceId(supplierInvoice.SupplierInvoiceId).Find(i => i.SupplierInvoiceId == (int)id); var tuple = Tuple.Create(invoiceDetails, supplierInvoice); if (supplierInvoice == null) { return(HttpNotFound()); } return(View(tuple)); }
/// <summary> /// Alissa Duffy /// Updated: 2017/04/21 /// /// Loads the Supplier Invoice Details Window. /// Standardized method. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Window_Loaded(object sender, RoutedEventArgs e) { lblInvoiceId.Content = "Invoice " + _supplierInvoice.SupplierInvoiceId; lblTotalAmount.Content = _supplierInvoice.Total.ToString("c"); lblAmountPaidAmount.Content = _supplierInvoice.AmountPaid.ToString("c"); Supplier supplierAssociated = null; try { supplierAssociated = _supplierManager.RetrieveSupplierBySupplierID(_supplierInvoice.SupplierId); if (null != supplierAssociated) { lblSupplierName.Content = _supplierManager.RetrieveSupplierName(supplierAssociated.UserId); lblFarmName.Content = supplierAssociated.FarmName; } } catch (Exception ex) { if (null != ex.InnerException) { MessageBox.Show(ex.Message + "\n\n" + ex.InnerException.Message); } else { MessageBox.Show(ex.Message); } } try { _invoiceLines = _supplierInvoiceManager.RetrieveSupplierInvoiceLinesByInvoiceId(_supplierInvoice.SupplierInvoiceId); } catch (Exception ex) { if (null != ex.InnerException) { MessageBox.Show(ex.Message + "\n\n" + ex.InnerException.Message); } else { MessageBox.Show(ex.Message); } } dgSupplierInvoiceLines.ItemsSource = _invoiceLines; }