Esempio n. 1
0
        public static OrderDetail[] GetOrderDetails(order selectedOrder)
        {
            List<OrderDetail> detailList = new List<OrderDetail>();
            SqlCommand command = CreateCommand("SELECT * FROM OrderInfo WHERE OrderID = \'" + selectedOrder.OrderID.ToString() + "\'");
            command.Connection.Open();

            reader = command.ExecuteReader();
            while (reader.Read())
            {
                detailList.Add(new OrderDetail((int)reader["Quantity"], (string)reader["Product"]));
            }

            OrderDetail[] details = detailList.ToArray();
            return details;
        }
 public OrdersWindowViewModel(order[] _orders)
 {
     Orders = _orders;
     if(Orders.Length > 0)
         Order = Orders[0];
 }