/// <summary>
        /// Gets supported values by element.
        /// </summary>
        /// <param name="element">OrderPriority element.</param>
        /// <returns>Array of supported values.</returns>
        static private string _GetSupportedValues(OrderPriority element)
        {
            string supportedValues = null;

            switch (element)
            {
            case OrderPriority.High:
                supportedValues = Properties.Resources.OrderPriorityHighSupportedValues;
                break;

            case OrderPriority.Normal:
                supportedValues = Properties.Resources.OrderPriorityNormalSupportedValues;
                break;

            case OrderPriority.Low:
                supportedValues = Properties.Resources.OrderPriorityLowSupportedValues;
                break;

            case OrderPriority.Urgent:
                supportedValues = Properties.Resources.OrderPriorityUrgentSupportedValues;
                break;

            default:
                Debug.Assert(false);     // NOTE: not supported
                break;
            }

            return(supportedValues);
        }
 public Order(Customer c, CarModel m, OrderPriority priority = OrderPriority.Normal)
 {
     this.Customer = c;
     this.Model    = m;
     // Orders have a Normal priority by default.
     this.ChangeOrderPriority(priority);
 }
Beispiel #3
0
        /// <summary>
        /// Convert Enum value to string.
        /// </summary>
        /// <param name="value">Enum value, which must be converted.</param>
        /// <param name="targetType">Ignored.</param>
        /// <param name="parameter">Ignored.</param>
        /// <param name="culture">Ignored.</param>
        /// <returns><c>String</c> representing enum's value.</returns>
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string result = string.Empty;

            // If value isnt null - convert.
            if (value != null)
            {
                OrderPriority syncType = (OrderPriority)value;

                switch (syncType)
                {
                // Convert selected synctype to it's string representation.
                case OrderPriority.High:
                    result = App.Current.GetString("OrderPriorityHigh");
                    break;

                case OrderPriority.Normal:
                    result = App.Current.GetString("OrderPriorityNormal");
                    break;

                default:
                    // Not supported Enum value.
                    Debug.Assert(false);
                    break;
                }
            }

            return(result);
        }
Beispiel #4
0
        public ActionResult DeleteConfirmed(int id)
        {
            OrderPriority orderPriority = db.OrderPriorities.Find(id);

            db.OrderPriorities.Remove(orderPriority);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #5
0
 public ActionResult Edit([Bind(Include = "Id,PriorityName,PriorityDescription")] OrderPriority orderPriority)
 {
     if (ModelState.IsValid)
     {
         db.Entry(orderPriority).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(orderPriority));
 }
Beispiel #6
0
        public ActionResult Create([Bind(Include = "Id,PriorityName,PriorityDescription")] OrderPriority orderPriority)
        {
            if (ModelState.IsValid)
            {
                db.OrderPriorities.Add(orderPriority);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(orderPriority));
        }
Beispiel #7
0
 public static Line54OrderInformation Create(int rackNumber, int tubeNumber, OrderPriority orderPriority, string leaderText1 = "", string leaderText2 = "")
 {
     return(new Line54OrderInformation()
     {
         SamplePositionRackNumber = rackNumber,
         SamplePositionTubeNumber = tubeNumber,
         OrderPriority = orderPriority,
         SampleLeaderText1 = leaderText1,
         SampleLeaderText2 = leaderText2
     });
 }
        public PageParseOrderDTO TryToStartNewParse(string url, OrderPriority priority)
        {
            var parseOrder = GetParseOrderByUrl(url);

            if (parseOrder != null)
            {
                return(parseOrder);
            }

            return(StartNewParse(url, priority));
        }
Beispiel #9
0
        public void ChangePriority(OrderPriority priority, IClock clock)
        {
            if (Priority == priority)
            {
                return;
            }

            var originalPriority = Priority;

            Priority = priority;
            DomainEvents.Add(new OrderPriorityChangedEvent(this, originalPriority, clock));
        }
Beispiel #10
0
        // GET: OrderPriorities/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            OrderPriority orderPriority = db.OrderPriorities.Find(id);

            if (orderPriority == null)
            {
                return(HttpNotFound());
            }
            return(View(orderPriority));
        }
Beispiel #11
0
        public PageParseOrderDTO StartNewParse(string url, OrderPriority priority)
        {
            var newParseOrder = new PageParseOrderDTO()
            {
                OrderCreated = DateTime.Now,
                OrderGUID    = Guid.NewGuid().ToString(),
                Url          = url,
                Priority     = priority
            };

            lock (_queueOfOrdersToParse)
            {
                _queueOfOrdersToParse.Add(newParseOrder);
            }

            return(newParseOrder);
        }
Beispiel #12
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hash = 17;
         hash = hash * 29 + MessageType.GetHashCode();
         hash = hash * 29 + Symbol.GetHashCode();
         hash = hash * 29 + OrderId.GetHashCode();
         hash = hash * 29 + MMID.GetHashCode();
         hash = hash * 29 + Side.GetHashCode();
         hash = hash * 29 + Price.GetHashCode();
         hash = hash * 29 + Size.GetHashCode();
         hash = hash * 29 + OrderPriority.GetHashCode();
         hash = hash * 29 + Precision.GetHashCode();
         hash = hash * 29 + OrderTime.GetHashCode();
         hash = hash * 29 + OrderDate.GetHashCode();
         return(hash);
     }
 }
        /// <summary>
        /// Changes the priority of the current order.
        /// </summary>
        /// <param name="priority">The new priority that should be assigned.</param>
        public void ChangeOrderPriority(OrderPriority priority)
        {
            this.Priority = priority;

            // Open connection to database
            using (MySqlConnection con = ApplicationSettings.GetConnection())
            {
                con.Open();

                // Change order's priority in database
                MySqlCommand cmd = new MySqlCommand("UPDATE `order` SET `priority`= @p where `order_id`= @id;", con);
                cmd.Parameters.AddWithValue("@p", this.Priority);
                cmd.Parameters.AddWithValue("@id", this.ID);

                cmd.ExecuteNonQuery();

                // Close connection
                con.Close();
            }
        }
 /// <summary>
 /// Constructor that does not specify an explicit list of procedures.
 /// </summary>
 /// <param name="enteredTime"></param>
 /// <param name="enteredBy"></param>
 /// <param name="enteredComment"></param>
 /// <param name="accessionNumber"></param>
 /// <param name="patient"></param>
 /// <param name="visit"></param>
 /// <param name="diagnosticService"></param>
 /// <param name="reasonForStudy"></param>
 /// <param name="priority"></param>
 /// <param name="orderingFacility"></param>
 /// <param name="performingFacility"></param>
 /// <param name="schedulingRequestTime"></param>
 /// <param name="orderingPractitioner"></param>
 /// <param name="resultRecipients"></param>
 public OrderCreationArgs(DateTime enteredTime, Staff enteredBy, string enteredComment, string accessionNumber,
                          Patient patient, Visit visit, DiagnosticService diagnosticService, string reasonForStudy, OrderPriority priority,
                          Facility orderingFacility, Facility performingFacility, DateTime?schedulingRequestTime, ExternalPractitioner orderingPractitioner,
                          IList <ResultRecipient> resultRecipients)
 {
     EnteredTime           = enteredTime;
     EnteredBy             = enteredBy;
     EnteredComment        = enteredComment;
     AccessionNumber       = accessionNumber;
     Patient               = patient;
     Visit                 = visit;
     DiagnosticService     = diagnosticService;
     ReasonForStudy        = reasonForStudy;
     Priority              = priority;
     OrderingFacility      = orderingFacility;
     PerformingFacility    = performingFacility;
     SchedulingRequestTime = schedulingRequestTime;
     OrderingPractitioner  = orderingPractitioner;
     ResultRecipients      = resultRecipients;
 }
Beispiel #15
0
		/// <summary>
		/// Constructor that does not specify an explicit list of procedures.
		/// </summary>
		/// <param name="enteredTime"></param>
		/// <param name="enteredBy"></param>
		/// <param name="enteredComment"></param>
		/// <param name="accessionNumber"></param>
		/// <param name="patient"></param>
		/// <param name="visit"></param>
		/// <param name="diagnosticService"></param>
		/// <param name="reasonForStudy"></param>
		/// <param name="priority"></param>
		/// <param name="orderingFacility"></param>
		/// <param name="performingFacility"></param>
		/// <param name="schedulingRequestTime"></param>
		/// <param name="orderingPractitioner"></param>
		/// <param name="resultRecipients"></param>
		public OrderCreationArgs(DateTime enteredTime, Staff enteredBy, string enteredComment, string accessionNumber,
			Patient patient, Visit visit, DiagnosticService diagnosticService, string reasonForStudy, OrderPriority priority,
			Facility orderingFacility, Facility performingFacility, DateTime? schedulingRequestTime, ExternalPractitioner orderingPractitioner,
			IList<ResultRecipient> resultRecipients)
		{
			EnteredTime = enteredTime;
			EnteredBy = enteredBy;
			EnteredComment = enteredComment;
			AccessionNumber = accessionNumber;
			Patient = patient;
			Visit = visit;
			DiagnosticService = diagnosticService;
			ReasonForStudy = reasonForStudy;
			Priority = priority;
			OrderingFacility = orderingFacility;
			PerformingFacility = performingFacility;
			SchedulingRequestTime = schedulingRequestTime;
			OrderingPractitioner = orderingPractitioner;
			ResultRecipients = resultRecipients;
		}
Beispiel #16
0
    /// <summary>
    /// Adds a new action to the agent cursor controller.
    /// </summary>
    /// <param name="action">The cursor action to perform.</param>
    /// <param name="priority">When should this action be performed.</param>
    public void AddAction(CursorAction action, OrderPriority priority)
    {
        // Check for invalid action.
        if (action.path == null)
        {
            throw new ArgumentNullException("action.path", "Path must have at least two points.");
        }
        else if (action.path.Length < 2)
        {
            throw new ArgumentException("Path must have at least two points.", "action.path");
        }

        if (isEnabled)
        {
            // Add the action based on the action
            // priority.
            switch (priority)
            {
            case OrderPriority.Queued:
                actions.Add(action);
                break;

            case OrderPriority.Immediate:
                actions.Insert(0, action);
                break;

            default:
                // Throw if order priority enum is updated,
                // but the appropriate behavior has not been
                // added for this switch block.
                throw new NotImplementedException();
            }
            // If the controller is not performing an
            // action, start its Update routine.
            if (actionState == ActionState.AwaitingAction)
            {
                PullAction();
            }
        }
    }
Beispiel #17
0
        private void InsertTestData(ApplicationDbContext context)
        {
            if (!context.Countries.Any())
            {
                List <CountryDto> countries = TestDataGenerator.TestDataGenerator.GenerateCountries();
                foreach (var country in countries)
                {
                    Country newCountry = new Country()
                    {
                        CountryName = country.CountryName
                    };
                    context.Countries.Add(newCountry);
                }
            }

            if (!context.Regions.Any())
            {
                List <RegionDto> regions = TestDataGenerator.TestDataGenerator.GenerateRegions();
                foreach (var item in regions)
                {
                    Region newItem = new Region()
                    {
                        RegionName = item.RegionName
                    };
                    context.Regions.Add(newItem);
                }
            }

            if (!context.OrderPriorities.Any())
            {
                List <OrderPriorityDto> orderPriorities = TestDataGenerator.TestDataGenerator.GenerateOrderPriorities();
                foreach (var item in orderPriorities)
                {
                    OrderPriority newItem = new OrderPriority()
                    {
                        OrderPriorityName = item.OrderPriorityName
                    };
                    context.OrderPriorities.Add(newItem);
                }
            }

            if (!context.SalesChannels.Any())
            {
                List <SalesChannelDto> salesChannels = TestDataGenerator.TestDataGenerator.GenerateSalesChannels();
                foreach (var item in salesChannels)
                {
                    SalesChannel newItem = new SalesChannel()
                    {
                        SalesChannelName = item.SalesChannelName
                    };
                    context.SalesChannels.Add(newItem);
                }
            }

            if (!context.ItemTypes.Any())
            {
                List <ItemTypeDto> itemTypes = TestDataGenerator.TestDataGenerator.GenerateItemTypes();
                foreach (var item in itemTypes)
                {
                    ItemType newItem = new ItemType()
                    {
                        ItemTypeName = item.ItemTypeName
                    };
                    context.ItemTypes.Add(newItem);
                }
            }
        }
Beispiel #18
0
 public void setPriority_of_order(OrderPriority priority_of_order)
 {
     this.priority_of_order = priority_of_order;
 }
Beispiel #19
0
        static async Task SaveRecordFromCsv(CsvReader csvReader, int index)
        {
            var    regionKey = csvReader.GetField("Region");
            Region region;

            if (regionKeys.Contains(regionKey))
            {
                region = regions.First(region => region.Name == regionKey);
            }
            else
            {
                regionKeys.Add(regionKey);
                region = new Region {
                    Name = regionKey
                };
                regions.Add(region);
            }

            var     countryKey = csvReader.GetField("Country");
            Country country;

            if (countriesKeys.Contains(countryKey))
            {
                country        = countries.First(country => country.Name == countryKey);
                country.Region = region;
            }
            else
            {
                countriesKeys.Add(countryKey);
                country = new Country
                {
                    Name   = countryKey,
                    Region = region
                };
                countries.Add(country);
            }

            var  itemKey = csvReader.GetField("Item Type");
            Item item;

            if (itemKeys.Contains(itemKey))
            {
                item = items.First(item => item.Name == itemKey);
            }
            else
            {
                itemKeys.Add(itemKey);
                item = new Item {
                    Name = itemKey
                };
                items.Add(item);
            }

            var           orderPriorityKey = csvReader.GetField("Order Priority");
            OrderPriority orderPriority;

            if (orderPriorityKeys.Contains(orderPriorityKey))
            {
                orderPriority = orderPriorities.First(orderPriority => orderPriority.Symbol == orderPriorityKey);
            }
            else
            {
                orderPriorityKeys.Add(orderPriorityKey);
                orderPriority = new OrderPriority {
                    Symbol = orderPriorityKey
                };
                orderPriorities.Add(orderPriority);
            }

            var   orderKey = csvReader.GetField <int>("Order ID");
            Order order;

            if (orderKeys.Contains(orderKey))
            {
                order = orders.First(order => order.Id == orderKey);
            }
            else
            {
                orderKeys.Add(orderKey);
                order = new Order
                {
                    Id            = orderKey,
                    OrderedAt     = csvReader.GetField <DateTime>("Order Date"),
                    OrderPriority = orderPriority
                };
                orders.Add(order);
            }

            var sale = new Sale
            {
                SalesChannel = csvReader.GetField("Sales Channel"),
                ShippedAt    = csvReader.GetField <DateTime>("Ship Date"),
                UnitsSold    = csvReader.GetField <int>("Units Sold"),
                UnitPrice    = csvReader.GetField <decimal>("Unit Price"),
                UnitCost     = csvReader.GetField <decimal>("Unit Cost"),
                TotalRevenue = csvReader.GetField <decimal>("Total Revenue"),
                TotalCost    = csvReader.GetField <decimal>("Total Cost"),
                TotalProfit  = csvReader.GetField <decimal>("Total Profit"),
                Order        = order,
                Item         = item,
                Country      = country
            };

            sales[index] = sale;

            if (index == _chunkSize - 1)
            {
                _dbContext.Sales.AddRange(sales.ToList().Take(_chunkSize));
                await _dbContext.SaveChangesAsync();

                _arrayPool.Return(sales, true);
                sales = _arrayPool.Rent(_chunkSize);

                Console.WriteLine($"Chunk {_currentChunkNo + 1} was saved.");

                _currentChunkNo += 1;
            }
        }
Beispiel #20
0
 /// <summary>
 /// Creates and places an order with the specified <paramref name="customer"/> and
 /// <paramref name="model"/>. Optionally, there can be a priority, but by default it is <see cref="OrderPriority.Normal"/>.
 /// </summary>
 /// <param name="customer">The customer of the order.</param>
 /// <param name="model"></param>
 /// <param name="op"></param>
 public void OrderModel(Customer customer, CarModel model, OrderPriority op = OrderPriority.Normal)
 {
     this.PlaceOrder(new Order(customer, model, op));
 }
        /// <summary>
        /// Gets supported values by element.
        /// </summary>
        /// <param name="element">OrderPriority element.</param>
        /// <returns>Array of supported values.</returns>
        private static string _GetSupportedValues(OrderPriority element)
        {
            string supportedValues = null;
            switch (element)
            {
                case OrderPriority.High:
                    supportedValues = Properties.Resources.OrderPriorityHighSupportedValues;
                    break;
                case OrderPriority.Normal:
                    supportedValues = Properties.Resources.OrderPriorityNormalSupportedValues;
                    break;
                default:
                    Debug.Assert(false); // NOTE: not supported
                    break;
            }

            return supportedValues;
        }
Beispiel #22
0
        internal void SaveToDataBase()
        {
            LinnWorks.Models.Import import = new LinnWorks.Models.Import();
            import.LastModifyUserId = user_id;
            import.LastModifyDttm   = DateTime.UtcNow;

            foreach (DataRow oRow in values.Rows)
            {
                string regionName            = oRow["Region"].ToString();
                string countryName           = oRow["Country"].ToString();
                string itemTypeName          = oRow["Item Type"].ToString();
                string orderPriorityName     = oRow["Order Priority"].ToString();
                int    orderIdExt            = Convert.ToInt32(oRow["Order ID"]);
                LinnWorks.Models.Order order = new LinnWorks.Models.Order();
                if (context.Orders.Where(x => x.OrderIdExt == orderIdExt).Any())
                {
                    order = context.Orders.Where(x => x.OrderIdExt == orderIdExt).FirstOrDefault();
                }
                else
                {
                    context.Orders.Add(order);
                }
                order.OrderDate        = Convert.ToDateTime(oRow["Order Date"]);
                order.OrderIdExt       = orderIdExt;
                order.ShipDate         = Convert.ToDateTime(oRow["Ship Date"]);
                order.UnitsSold        = Convert.ToInt32(oRow["Units Sold"]);
                order.UnitPrice        = Convert.ToDouble(oRow["Unit Cost"]);
                order.TotalRevenue     = Convert.ToDouble(oRow["Total Revenue"]);
                order.TotalCost        = Convert.ToDouble(oRow["Total Cost"]);
                order.TotalProfit      = Convert.ToDouble(oRow["Total Profit"]);
                order.LastModifyDttm   = DateTime.UtcNow;
                order.LastModifyUserId = user_id;

                Region region = new Region();
                if (!context.Regions.Where(x => x.Name == regionName).Any())
                {
                    region.Name             = regionName;
                    region.LastModifyDttm   = DateTime.UtcNow;
                    region.LastModifyUserId = user_id;
                    context.Regions.Add(region);
                }
                else
                {
                    region = context.Regions.Where(x => x.Name == regionName).FirstOrDefault();
                }
                region.Orders.Add(order);
                LinnWorks.Models.Country country = new LinnWorks.Models.Country();
                if (!context.Countries.Where(x => x.Name == countryName).Any())
                {
                    country.Name             = countryName;
                    country.LastModifyDttm   = DateTime.UtcNow;
                    country.LastModifyUserId = user_id;
                    context.Countries.Add(country);
                }
                else
                {
                    country = context.Countries.Where(x => x.Name == countryName).FirstOrDefault();
                }
                country.Orders.Add(order);
                ItemType itemType = new ItemType();
                if (!context.ItemTypes.Where(x => x.Name == itemTypeName).Any())
                {
                    itemType.Name             = itemTypeName;
                    itemType.LastModifyDttm   = DateTime.UtcNow;
                    itemType.LastModifyUserId = user_id;
                    context.ItemTypes.Add(itemType);
                }
                else
                {
                    itemType = context.ItemTypes.Where(x => x.Name == itemTypeName).FirstOrDefault();
                }
                itemType.Orders.Add(order);
                OrderPriority orderPriority = new OrderPriority();
                if (!context.OrderPriorities.Where(x => x.name == orderPriorityName).Any())
                {
                    orderPriority.name             = orderPriorityName;
                    orderPriority.LastModifyDttm   = DateTime.UtcNow;
                    orderPriority.LastModifyUserId = user_id;
                    context.OrderPriorities.Add(orderPriority);
                }
                else
                {
                    orderPriority = context.OrderPriorities.Where(x => x.name == orderPriorityName).FirstOrDefault();
                }
                orderPriority.Orders.Add(order);
                import.Orders.Add(order);
            }
            context.Imports.Add(import);
            context.SaveChanges();
        }
        public async Task ImportAsync(IEnumerable <SaleDto> sales, CancellationToken cancellationToken)
        {
            var itemKeys = sales
                           .Select(sale => sale.ItemName)
                           .Distinct();
            var countryKeys = sales
                              .Select(sale => sale.CountryName)
                              .Distinct();
            var regionKeys = sales
                             .Select(sale => sale.CountryRegionName)
                             .Distinct();
            var orderPriorityKeys = sales
                                    .Select(sale => sale.OrderPrioritySymbol)
                                    .Distinct();

            var items           = new Dictionary <string, Item>();
            var countries       = new Dictionary <string, Country>();
            var regions         = new Dictionary <string, Region>();
            var orderPriorities = new Dictionary <string, OrderPriority>();

            async Task itemsRead()
            {
                items = await _dbContext.Items
                        .Where(item => itemKeys.Contains(item.Name))
                        .ToDictionaryAsync(item => item.Name);
            }

            async Task countriesRead()
            {
                countries = await _dbContext.Countries
                            .Where(country => countryKeys.Contains(country.Name))
                            .ToDictionaryAsync(country => country.Name);
            }

            async Task regionsRead()
            {
                regions = await _dbContext.Regions
                          .Where(region => regionKeys.Contains(region.Name))
                          .ToDictionaryAsync(region => region.Name);
            }

            async Task orderPrioritiesRead()
            {
                orderPriorities = await _dbContext.OrderPriorities
                                  .Where(orderPriority => orderPriorityKeys.Contains(orderPriority.Symbol))
                                  .ToDictionaryAsync(orderPriority => orderPriority.Symbol);
            }

            await Task.WhenAll(new Task[]
            {
                itemsRead(),
                countriesRead(),
                regionsRead(),
                orderPrioritiesRead()
            });


            var entities = new List <Sale>();

            foreach (var sale in sales)
            {
                Item          item;
                Country       country;
                Region        region;
                OrderPriority orderPriority;

                if (items.ContainsKey(sale.ItemName))
                {
                    item = items[sale.ItemName];
                }
                else
                {
                    item = new Item
                    {
                        Id   = 0,
                        Name = sale.ItemName
                    };
                    items.Add(sale.ItemName, item);
                }

                if (regions.ContainsKey(sale.CountryRegionName))
                {
                    region = regions[sale.CountryRegionName];
                }
                else
                {
                    region = new Region
                    {
                        Id   = 0,
                        Name = sale.CountryRegionName
                    };
                    regions.Add(sale.CountryRegionName, region);
                }

                if (countries.ContainsKey(sale.CountryName))
                {
                    country = countries[sale.CountryName];

                    if (country.RegionId != region.Id)
                    {
                        country.Id       = 0;
                        country.RegionId = region.Id;
                        country.Region   = region;
                    }
                }
                else
                {
                    country = new Country
                    {
                        Id       = 0,
                        Name     = sale.CountryName,
                        RegionId = region.Id,
                        Region   = region
                    };
                    countries.Add(sale.CountryName, country);
                }

                if (orderPriorities.ContainsKey(sale.OrderPrioritySymbol))
                {
                    orderPriority = orderPriorities[sale.OrderPrioritySymbol];
                }
                else
                {
                    orderPriority = new OrderPriority
                    {
                        Id     = 0,
                        Symbol = sale.OrderPrioritySymbol
                    };
                    orderPriorities.Add(sale.OrderPrioritySymbol, orderPriority);
                }

                var order = new Order
                {
                    OrderedAt     = sale.OrderedAt,
                    OrderPriority = orderPriority
                };

                entities.Add(new Sale
                {
                    SalesChannel = sale.SalesChannel,
                    ShippedAt    = sale.ShippedAt,
                    UnitsSold    = sale.UnitsSold,
                    UnitPrice    = sale.UnitPrice,
                    UnitCost     = sale.UnitCost,
                    TotalRevenue = sale.TotalRevenue,
                    TotalCost    = sale.TotalCost,
                    TotalProfit  = sale.TotalProfit,
                    Order        = order,
                    Item         = item,
                    Country      = country
                });
            }

            _dbContext.Sales.AddRange(entities);
            await _dbContext.SaveChangesAsync(cancellationToken);
        }
 public OrderPriorityChangedEvent(Order order, OrderPriority originalPriority, IClock clock)
 {
     Order            = order;
     OriginalPriority = originalPriority;
     Timestamp        = clock.UtcNow;
 }