Digital Twin - GUI
Order.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Threading.Tasks;
6 
7 namespace GUI.Datatypes
8 {
12  class Order
13  {
17  private DateTime dueTime;
21  public int Amount;
25  private static int hour = 5;
26 
32  public Order(String dueDay, int amount)
33  {
34  dueTime = Convert.ToDateTime(dueDay).AddHours(hour);
35  this.Amount = amount;
36  }
37 
44  public bool IsDueBetween(DateTime start, DateTime end)
45  {
46  if (dueTime.CompareTo(start) > 0 && dueTime.CompareTo(end) <= 0)
47  {
48  return true;
49  }
50  else
51  {
52  return false;
53  }
54  }
55 
62  public int getDueTimeslot(DateTime start, double d)
63  {
64  double hours = dueTime.Subtract(start).TotalHours;
65  return (int)(hours / d);
66  }
67  }
68 }
Order(String dueDay, int amount)
The constructor.
Definition: Order.cs:32
bool IsDueBetween(DateTime start, DateTime end)
Determins if order is due in a given time interval.
Definition: Order.cs:44
int Amount
How many items are requested.
Definition: Order.cs:21
DateTime dueTime
When is this order due.
Definition: Order.cs:17
int getDueTimeslot(DateTime start, double d)
Computes the timeslot when the order is due.
Definition: Order.cs:62
A wrapper class for orders.
Definition: Order.cs:12