예제 #1
0
 private void checkoutButton_Click(object sender, RoutedEventArgs e)
 {
     if (clientView.Visibility == Visibility.Collapsed)
     {
         productView.Visibility = Visibility.Collapsed;
         eventView.Visibility   = Visibility.Collapsed;
         clientView.Visibility  = Visibility.Visible;
         showWarningLabel("You need to be in Client view!");
     }
     else
     {
         ClientViewer clientToDelete = (ClientViewer)clientView.SelectedItem;
         for (int i = 0; i < shoplogic.shop.Clients.Count(); i++)
         {
             if (clientToDelete.Name == shoplogic.shop.Clients[i].Name)
             {
                 if (shoplogic.Checkout(shoplogic.shop.Clients[i]))
                 {
                     updateLists();
                 }
                 else
                 {
                     showWarningLabel("You can't checkout " + clientToDelete.Name);
                 }
             }
         }
     }
 }
예제 #2
0
        public Monitoring()
        {
            InitializeComponent();


            this.Unloaded            += Monitoring_Unloaded;
            Application.Current.Exit += Current_Exit;
            _ClientViewer             = new ClientViewer(Convert.ToInt32(Properties.Settings.Default.PresenterPort));
            _ClientViewer.AddNewClient(Properties.Settings.Default.PresenterIP, "test");

            _ClientViewer.m_AppDef.CurrClient = (BaseClass.ClientInfo)_ClientViewer.m_AppDef.ArrClients[0];
            IsLive = true;
            m_ExecutingQueryThread = new Thread(new ParameterizedThreadStart(ExecutingQueries));
            m_ExecutingQueryThread.Start();
        }
예제 #3
0
 private void deleteButton_Click(object sender, RoutedEventArgs e)
 {
     if (eventView.Visibility == Visibility.Visible)
     {
         showWarningLabel("You need to be in Client or Product view!");
     }
     else if (clientView.Visibility == Visibility.Visible)
     {
         ClientViewer clientToDelete = (ClientViewer)clientView.SelectedItem;
         shoplogic.LeaveShopp(new Client(0, clientToDelete.Name));
     }
     else
     {
         ProductViewer productToDelete = (ProductViewer)productView.SelectedItem;
         shoplogic.RemoveFromStock(new Product(productToDelete.Price, productToDelete.Name));
     }
     updateLists();
 }
예제 #4
0
 private void deleteFromBasketButton_Click(object sender, RoutedEventArgs e)
 {
     if (clientView.Visibility == Visibility.Collapsed)
     {
         productView.Visibility = Visibility.Collapsed;
         eventView.Visibility   = Visibility.Collapsed;
         clientView.Visibility  = Visibility.Visible;
         showWarningLabel("You need to be in Client view!");
     }
     else
     {
         client = (ClientViewer)clientView.SelectedItem;
         clientLabel.Content         = client.Name;
         mainPanel.Visibility        = Visibility.Collapsed;
         productClientButton.Content = "Delete";
         doWhat = "Delete";
         productSelectPanel.Visibility = Visibility.Visible;
         updateLists();
     }
 }