Пример #1
0
 /// <summary>
 ///     Adds a new order to the Respiratory
 /// </summary>
 /// <param name="requiredDate">The data the oder is required</param>
 /// <param name="name">The name of the ship containing the order</param>
 /// <param name="address">The ships address</param>
 /// <param name="city">The ships city</param>
 /// <param name="region">The ships region</param>
 /// <param name="postalCode">The ships postalCode</param>
 /// <param name="country">The ships country</param>
 public void AddOrder(DateTime requiredDate, string name, string address, string city, string region,
     string postalCode, string country)
 {
     var order = new Orders(orders.Count - 1, requiredDate, name, address, city, region, postalCode, country);
     orders.Add(order);
     if (newOrderEvent != null)
         newOrderEvent(order);
 }
Пример #2
0
 public void CreateOrder(Orders newOrder)
 {
     //get highest id using LINQ
     int newID = Orders().Max(a => a.OrderID) + 1;
     newOrder.OrderID = newID;
     context.Orders.Add(newOrder);
     context.SaveChanges();
 }
Пример #3
0
 public Orders CreateOrder(DateTime requiredDate, string shipName, string shipAddress,string shipCity,string shipRegion,string shipPostalCode,string shipCountry)
 {
     //get highest id using LINQ
     int newID = Orders().Max(a => a.OrderID) + 1;
     Orders order = new Model.Orders(newID,requiredDate,shipName,shipAddress,shipCity,shipRegion,shipPostalCode,shipCountry);
     context.Orders.Add(order);
     context.SaveChanges();
     return order;
 }
Пример #4
0
 public Order_Details(int newID,int productID,decimal unitPrice,short quantity,float discount,Orders order, Products product)
 {
     this.OrderID = newID;
     this.ProductID = productID;
     this.UnitPrice = unitPrice;
     this.Quantity = quantity;
     this.Discount = discount;
     this.Orders = order;
     this.Products = product;
 }
Пример #5
0
 /// <summary>
 /// Adds a new order to the Respiratory
 /// </summary>
 /// <param name="requiredDate">The data the oder is required</param>
 /// <param name="name">The name of the ship containing the order</param>
 /// <param name="address">The ships address</param>
 /// <param name="city">The ships city</param>
 /// <param name="region">The ships region</param>
 /// <param name="postalCode">The ships postalCode</param>
 /// <param name="country">The ships country</param>
 public void AddOrder(DateTime requiredDate, string name, string address, string city, string region, string postalCode, string country)
 {
     Orders order = new Orders();
     order.RequiredDate = requiredDate;
     order.ShipName = name;
     order.ShipAddress = address;
     order.ShipCity = city;
     order.ShipRegion = region;
     order.ShipPostalCode = postalCode;
     order.ShipCountry = country;
     order.OrderDate = DateTime.Now;
     respiratory.CreateOrder(order);
         newOrderEvent(order);
 }
Пример #6
0
 /// <summary>
 ///     Adds a new order to the Respiratory
 /// </summary>
 /// <param name="requiredDate">The data the oder is required</param>
 /// <param name="name">The name of the ship containing the order</param>
 /// <param name="address">The ships address</param>
 /// <param name="city">The ships city</param>
 /// <param name="region">The ships region</param>
 /// <param name="postalCode">The ships postalCode</param>
 /// <param name="country">The ships country</param>
 public void AddOrder(DateTime requiredDate, string name, string address, string city, string region,
     string postalCode, string country)
 {
     var order = new Orders();
     order.RequiredDate = requiredDate;
     order.ShipName = name;
     order.ShipAddress = address;
     order.ShipCity = city;
     order.ShipRegion = region;
     order.ShipPostalCode = postalCode;
     order.ShipCountry = country;
     order.OrderDate = DateTime.Now;
     orders.Add(order);
     if (newOrderEvent != null)
     newOrderEvent(order);
 }