private void LoadOrders() { PendingOrders.DataContext = null; OrderingServices orderSvc = new OrderingServices(true); PendingOrders.DataContext = orderSvc.GetAll(); }
/// <summary> /// Updates an order. /// </summary> /// <param name="order">The order to update.</param> public void UpdateOrder(Order order) { OrderingServices orderingSvc = new OrderingServices(); int lastingHours = order.OrderType.TimeToProcess - Convert.ToInt32((DateTime.Now - order.DateTime).TotalMinutes); if (lastingHours <= 0) { // Execute order & drop it this.ExecuteOrder(order); orderingSvc.DropOrder(order); } else { orderingSvc.UpdateLastingHours(order, lastingHours); } }
/// <summary> /// Places a team order. /// </summary> /// <param name="theTeam">The team which made the order.</param> /// <param name="orderTypeValue">The order type.</param> /// <param name="parameters">The parameters of the order.</param> public void PlaceTeamOrder(Team theTeam, EOrderType orderTypeValue, string parameters) { OrderingServices orderingSvc = new OrderingServices(); orderingSvc.PlaceTeamOrder(theTeam, orderTypeValue, parameters); }
/// <summary> /// Gets all orders. /// </summary> /// <returns>A list of orders.</returns> public IList<Order> GetAllOrders() { OrderingServices orderingSvc = new OrderingServices(); return orderingSvc.GetAll(); }