Ejemplo n.º 1
0
 private void PaymentButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (MessageBox.Show("Voulez-vous valider l'encaissement?", "Caisse", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
         {
             if (Math.Round(Payment.TotalToPay, 2) > 0)
             {
                 MessageBox.Show("L'encaissement est incomplet. Veuillez procéder au paiement.");
             }
             else
             {
                 MessageBox.Show("Vente terminée! Le ticket a été validé.");
                 ProductStockManager ProductStockManager = new ProductStockManager();
                 ProductStockManager.EditProductQuantity(InvoiceManager);
                 MethodPaymentManager.SetThePaymentMethod(InvoiceManager, PaymentMethod, Payment);
                 InvoiceManager.SaveInvoiceToDataBase();
                 ResetTheTicket();
                 ArticleToSellDataGrid.ItemsSource = ProductViewManager.JoinProductAndProductStockTables();
             }
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message);
     }
 }
Ejemplo n.º 2
0
 private void SearchAnArticleToSellTxtBox_GotFocus(object sender, RoutedEventArgs e)
 {
     SearchAnArticleToSellTxtBox.Text       = string.Empty;
     SearchAnArticleToSellTxtBox.Foreground = new SolidColorBrush(Colors.White);
     SearchAnArticleToSellTxtBox.GotFocus  += SearchAnArticleToSellTxtBox_GotFocus;
     if (SearchAnArticleToSellTxtBox.Text == string.Empty)
     {
         ProductViewManager.JoinProductAndProductStockTables();
     }
 }
Ejemplo n.º 3
0
 public SalesManagementPage()
 {
     CashRegisterManager = new CashRegisterManager();
     InitializeComponent();
     SearchAnArticleToSellTxtBox.Focus();
     ArticleToSellDataGrid.ItemsSource = ProductViewManager.JoinProductAndProductStockTables();
     ShowSellerNameOnTicket();
     ShowDateOnTicket();
     ShowTicketNumber();
 }
Ejemplo n.º 4
0
        private void AddToSellButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                SalesParametersWindow salesParametersWindow = new SalesParametersWindow();
                salesParametersWindow.ShowDialog();

                if (salesParametersWindow.RightParameters == true)
                {
                    CalculateTheTicketPrice();
                    ProductViewManager.JoinProductAndProductStockTables();
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Ejemplo n.º 5
0
 private void RefreshButton_Click(object sender, RoutedEventArgs e)
 {
     ArticleToSellDataGrid.ItemsSource = ProductViewManager.JoinProductAndProductStockTables();
 }
 public void ReloadDataGrid()
 {
     ProductsDataGrid.ItemsSource = ProductViewManager.JoinProductAndProductStockTables();
 }
 public InventoryManagementPage()
 {
     InitializeComponent();
     SearchTextBox.Focus();
     ProductsDataGrid.ItemsSource = ProductViewManager.JoinProductAndProductStockTables();
 }