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); } }
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(); } }
public SalesManagementPage() { CashRegisterManager = new CashRegisterManager(); InitializeComponent(); SearchAnArticleToSellTxtBox.Focus(); ArticleToSellDataGrid.ItemsSource = ProductViewManager.JoinProductAndProductStockTables(); ShowSellerNameOnTicket(); ShowDateOnTicket(); ShowTicketNumber(); }
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); } }
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(); }