On Tue, Jun 23, 2015 at 8:33 AM, Kurt Wendt <[email protected]> wrote:

> Actually - I'm not using .Net at all. Other developers are - and other
> systems here are. Just not the systems I am working on...
>
> -------------------

Life gets so much simpler when you use the Entity Framework ver 5 or 6 in
.Net.  Put MVC on top and you have a much easier life with respect to easy
communication of rules in your UI to user with little to no work.

This is the code to fetch data for a customer order passed in only the
param for OrderID id.

Order order = db.Orders.Include(o => o.OrderItems.Select(p =>
p.Product)).Single(q => q.OrderID == id);
            if (order == null)
            {
                return HttpNotFound();
            }
            ViewBag.CustomerID = new SelectList(db.Customers, "CustomerID",
"Firstname", order.CustomerID);
            return View(order);

This is the order class with two collections, Customer and OrderItems, in
it;
public class Order
    {
        public virtual int OrderID { get; set; }
        public virtual int CustomerID { get; set; }
        public virtual DateTime  OderDate { get; set; }
        public virtual double OrderTotal { get; set; }
        public virtual double OrderTax { get; set; }
        public Customer Customer { get; set; }
        public List<OrderItem> OrderItems {get; set;}
    }




-- 
Stephen Russell
Sr. Analyst
Ring Container Technology
Oakland TN

901.246-0159 cell


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cajidmyjgw4clbswt0ayn0eq42ahf78sdd_wateqlp+ot-ht...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to