Esempio n. 1
0
 public Order(MarketOrder order)
 {
     OrderId = order.OrderId;
     TypeId = order.TypeId;
     CharacterId = order.CharacterId;
     StationId = order.StationId;
     VolEntered = order.VolEntered;
     VolRemaining = order.VolRemaining;
     OrderState = order.OrderState;
     Cost = order.Price;
     Issued = DateTime.Parse(order.Issued);
     Finished = OrderState == (int)MarketOrderState.ExpiredOrFulfilled ? DateTime.UtcNow : DateTime.MaxValue;
 }
Esempio n. 2
0
        public async Task UpdateOrder(MarketOrder order)
        {
            if (VolRemaining != order.VolRemaining)
                VolRemaining = order.VolRemaining;

            if (OrderState != order.OrderState)
            {
                if (order.OrderState == (int)MarketOrderState.ExpiredOrFulfilled || order.OrderState == (int)MarketOrderState.Cancelled || order.OrderState == (int)MarketOrderState.Closed || order.OrderState == (int)MarketOrderState.CharacterDeleted)
                    Finished = DateTime.UtcNow;

                OrderState = order.OrderState;
            }

            if (Cost != order.Price)
                await Task.Run(() => Cost = order.Price);
        }