public ActionResult NewOrder(OrderIn Order) { Order.NewOrder(); int OrderId = OrderIn.GetLastOrderId(); var model = OrderIn.GetOrderDetail(OrderId); return View("Details", model); }
public static IEnumerable<OrderIn> GetOrders() { List<OrderIn> result = new List<OrderIn>(); foreach (var i in NorthwindDAL.GetTop10()) { OrderIn o = new OrderIn(); o.OrderDate = i.OrderDate; o.OrderID = i.OrderID; o.Sum = i.Sum; o.CustomerID = i.CustomerID; o.Status = i.Status; o.Sum= Math.Round(NorthwindDAL.OrderSum(i.OrderID),2); result.Add(o); } return result; }
public static OrderIn GetOrderDetail(int id) { var i = NorthwindDAL.Details(id); OrderIn o = new OrderIn(); o.OrderID = i.OrderID; o.CustomerID = i.CustomerID; o.EmployeeID = i.EmployeeID; o.OrderDate = i.OrderDate; o.RequiredDate = i.RequiredDate; o.ShippedDate = i.ShippedDate; o.ShipVia = i.ShipVia; o.Freight = i.Freight; o.ShipName = i.ShipName; o.ShipAddress = i.ShipAddress; o.ShipCity = i.ShipCity; o.ShipRegion = i.ShipRegion; o.ShipPostalCode = i.ShipPostalCode; o.ShipCountry = i.ShipCountry; o.Sum = i.Sum; o.Status = i.Status; o.OrderDetails = i.OrderDetails; return o; }