public UpdateOrderPage(BlApi.IBl bl, BO.Order order, ListView listView, BackgroundWorker worker) { InitializeComponent(); this.bl = bl; this.order = order; statusComboBox.ItemsSource = MyDictionary.OrderStatus.Select(x => MyDictionary.TranslateEnumToString(x)); UpdateOrderGrid.DataContext = this.order; this.listViewOrder = listView; email = worker; }
public static Order POOrder(BO.Order order) { return(new Order { OrderID = order.OrderID, Customer = POCustomer(order.Customer), OrderTime = order.OrderTime, TotalPrice = order.TotalPrice, Paid = order.Paid, Profit = order.Profit, Items = from item in order.Items select POItem(item) }); }
private void AddOrderButton_Click(object sender, RoutedEventArgs e) { Button btn = sender as Button; client = bl.GetClient(currentRequest.ClientID); order = new BO.Order() { ClientFirstName = client.Details.FirstName, ClientLastName = client.Details.LastName, HostID = host.Person.Id, HostingUnit = btn.DataContext as BO.HostingUnit, GuestRequest = currentRequest, OrderDate = DateTime.Today, Status = BO.Order_Status.PENDING }; try { order.Key = bl.AddOrder(order); MessageBox.Show("ההזמנה נוצרה בהצלחה"); myListview.ItemsSource = bl.GetHost(hostID).Orders; } catch (DuplicateWaitObjectException exception) { MessageBox.Show(exception.Message); } catch (MissingMemberException exception) { MessageBox.Show(exception.Message); } }