public static List <OrderViewModel> GetOrders() { List <OrderViewModel> orders = new List <OrderViewModel>(); var orderObjs = OrderAccess.GetOrderObjs(); foreach (var order in orderObjs) { orders.Add(GetOrder(order)); } return(orders); }
/// <summary> /// Calls the Access label to insert all the order items /// </summary> /// <param name="items"></param> /// <returns></returns> public static bool InsertAllOrderItems(List <int> items) { try { foreach (var item in items) { OrderItem order = new OrderItem { OrderId = OrderAccess.GetOrderObjs().Last().Id, DishId = item }; OrderItemAccess.AddOrderItem(order); } return(true); } catch { return(false); } }
public static OrderObj GetLastOrder() { return(OrderAccess.GetOrderObjs().Last()); }