|
| 1 | +using System.ComponentModel.DataAnnotations; |
| 2 | + |
| 3 | +namespace RemoteSaveAdaptor.Server.Models |
| 4 | +{ |
| 5 | + public class OrdersDetails |
| 6 | + { |
| 7 | + public static List<OrdersDetails> order = new List<OrdersDetails>(); |
| 8 | + public OrdersDetails() |
| 9 | + { |
| 10 | + |
| 11 | + } |
| 12 | + public OrdersDetails(int OrderID, string CustomerId, int EmployeeId, double Freight, bool Verified, DateTime OrderDate, string ShipCity, string ShipName, string ShipCountry, DateTime ShippedDate, string ShipAddress) |
| 13 | + { |
| 14 | + this.OrderID = OrderID; |
| 15 | + this.CustomerID = CustomerId; |
| 16 | + this.EmployeeID = EmployeeId; |
| 17 | + this.Freight = Freight; |
| 18 | + this.ShipCity = ShipCity; |
| 19 | + this.Verified = Verified; |
| 20 | + this.OrderDate = OrderDate; |
| 21 | + this.ShipName = ShipName; |
| 22 | + this.ShipCountry = ShipCountry; |
| 23 | + this.ShippedDate = ShippedDate; |
| 24 | + this.ShipAddress = ShipAddress; |
| 25 | + } |
| 26 | + |
| 27 | + public static List<OrdersDetails> GetAllRecords() |
| 28 | + { |
| 29 | + if (order.Count() == 0) |
| 30 | + { |
| 31 | + int code = 10000; |
| 32 | + for (int i = 1; i <= 2000; i++) |
| 33 | + { |
| 34 | + order.Add(new OrdersDetails(code + 1, "ALFKI", i + 0, 2.3 * i, false, new DateTime(1991, 05, 15), "Berlin", "Simons bistro", "Denmark", new DateTime(1996, 7, 16), "Kirchgasse 6")); |
| 35 | + order.Add(new OrdersDetails(code + 2, "ANATR", i + 2, 3.3 * i, true, new DateTime(1990, 04, 04), "Madrid", "Queen Cozinha", "Brazil", new DateTime(1996, 9, 11), "Avda. Azteca 123")); |
| 36 | + order.Add(new OrdersDetails(code + 3, "ANTON", i + 1, 4.3 * i, true, new DateTime(1957, 11, 30), "Cholchester", "Frankenversand", "Germany", new DateTime(1996, 10, 7), "Carrera 52 con Ave. Bolívar #65-98 Llano Largo")); |
| 37 | + order.Add(new OrdersDetails(code + 4, "BLONP", i + 3, 5.3 * i, false, new DateTime(1930, 10, 22), "Marseille", "Ernst Handel", "Austria", new DateTime(1996, 12, 30), "Magazinweg 7")); |
| 38 | + order.Add(new OrdersDetails(code + 5, "BOLID", i + 4, 6.3 * i, true, new DateTime(1953, 02, 18), "Tsawassen", "Hanari Carnes", "Switzerland", new DateTime(1997, 12, 3), "1029 - 12th Ave. S.")); |
| 39 | + code += 5; |
| 40 | + } |
| 41 | + } |
| 42 | + return order; |
| 43 | + } |
| 44 | + [Key] |
| 45 | + public int OrderID { get; set; } |
| 46 | + public string? CustomerID { get; set; } |
| 47 | + public int? EmployeeID { get; set; } |
| 48 | + public double? Freight { get; set; } |
| 49 | + public string? ShipCity { get; set; } |
| 50 | + public bool? Verified { get; set; } |
| 51 | + public DateTime? OrderDate { get; set; } |
| 52 | + public string? ShipName { get; set; } |
| 53 | + public string? ShipCountry { get; set; } |
| 54 | + public DateTime? ShippedDate { get; set; } |
| 55 | + public string? ShipAddress { get; set; } |
| 56 | + } |
| 57 | +} |
0 commit comments