Click here to Skip to main content
11,705,052 members (53,021 online)
Rate this: bad
Please Sign up or sign in to vote.
Hi, at the moment I have a OrderConfirmationController which has a Details view which displays the records. At the bottom of the Details View I want to add 5 fields from another table that will be displayed in the view but not sure how to add them.

At the bottom of the last table I want to implement a separate table containing the Product_ID, Description, Price, Quantity and Total from a Sales_Order_Line table but don't know how to add it as I can only reference one table using the @model at the start of the view.


Here is my code for the Details controller:
   public ActionResult Details(string documentNo, int documentType)
    // Compound key is used here so require both fields to be included in the SQL.
    Sales_Order confirmOrder = _data.Sales_Orders
       .Where(x => x.Document_Type == documentType && x.Document_No_ == documentNo)
    return View(confirmOrder);


Here is the code for my view:
@model SPR.Titanium.MultiChannel.ManagementConsolePortal.Sales_Order

<link href="~/Content/themes/ui-lightness/jquery-ui-1.10.3.custom.css" rel="stylesheet"     />
@section Scripts
<script src="~/js/jquery-1.9.1.js"></script>
Posted 18-Jun-13 2:22am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 609
1 OriginalGriff 439
2 Andy Lanng 215
3 CPallini 202
4 F-ES Sitecore 160
0 OriginalGriff 8,958
1 Sergey Alexandrovich Kryukov 8,276
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,606

Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 18 Jun 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100