Ejemplo n.º 1
0
        public Me()
        {
            InitializeComponent();
            CustomerServiceReference.CustomerServiceClient customerServiceProxy = new CustomerServiceReference.CustomerServiceClient();
            int customerId = Int16.Parse(Application.Current.Resources["CUSTOMER_ID"].ToString());

            CurrentSaldo.Content = "Saldo : \u20AC " + customerServiceProxy.Find(customerId).Balance;
        }
Ejemplo n.º 2
0
        private void SetRemainingBalance()
        {
            ProductServiceReference.ProductServiceClient   ProductServiceProxy  = new ProductServiceReference.ProductServiceClient();
            CustomerServiceReference.CustomerServiceClient customerServiceProxy = new CustomerServiceReference.CustomerServiceClient();

            double price = 0;

            foreach (ListBoxItem item in InventoryBox.Items)
            {
                Product product = ProductServiceProxy.Find(int.Parse(item.DataContext.ToString()));

                price += product.Price * int.Parse(item.Content.ToString().Split(',').Last().Trim());
            }

            int customerId = Int16.Parse(Application.Current.Resources["CUSTOMER_ID"].ToString());

            RemainingBalance.Content = customerServiceProxy.Find(customerId).Balance - price;
        }