Exemplo n.º 1
0
        private void RefreshOrders()
        {
            Orders.Clear();
            OrderContractClient client = new OrderContractClient();

            try
            {
                foreach (var item in client.GetOrders())
                {
                    Orders.Add(item);
                }
            }
            catch (FaultException fexc)
            {
                MessageBox.Show(string.Format("FaultException {0} Type {1}", fexc.Message));
            }
        }
Exemplo n.º 2
0
        private void BuyFromCart(object sender, RoutedEventArgs e)
        {
            OrderContractClient client = new OrderContractClient();

            BusinessOrderItem[] arr = Cart.ToArray();
            string result           = client.AddOrder(arr);

            if (result != null)
            {
                MessageBox.Show("Error: " + result);
            }
            else
            {
                Cart.Clear();
                RefreshGoods();
                RefreshOrders();
            }
        }