public void GetOrder() { Item OrderItem = new Item(); Customer c = new Customer(); Location l = new Location(); foreach (var item in _storeBL.GetOrder()) { if (item.CFK == currentCustomer.Id) { Console.WriteLine((_storeBL.GetCustomerById((int)item.CFK).ToString())); l = _storeBL.GetLocationById((int)item.LFK); Console.WriteLine(l.ToString() + "\n"); OrderItem = _storeBL.GetItemByOID((int)item.Id); // if(OrderItem.Id ==null || OrderItem.PFK==null) // { // Console.WriteLine((_storeBL.GetProductById(OrderItem.PFK)).ToString()); // Console.WriteLine($"Quantity {OrderItem.Quantity}"); // } Console.WriteLine(item.ToString()); //_storeBL.GetOIS } } Console.WriteLine("Press any key to continue"); Console.ReadLine(); }
// GET: OrderController/Details/5 /// <summary> /// View the details of specific orders(lcoation,Customer,Total,producsts, quantity) /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Details(int id) { Order o = _partsBL.GetOrderById(id); OrderDetailVM od = new OrderDetailVM(); od.CustomerName = _partsBL.GetCustomerById(o.CustomerId).CustomerName; od.LocationName = _partsBL.GetLocationById(o.LocationId).LocationName; od.ProductName = _partsBL.GetProductById(o.ProductId).ProductName; od.Quanity = o.Quantity; od.Total = o.Total; return(View(od)); }