Ejemplo n.º 1
0
 public FilteringWindow(AccountingBook accountingBook, Filter rememberedFilter, IEnumerable <Item> selectedItems)
 {
     InitializeComponent();
     this.accountingBook = accountingBook;
     this.SelectedItems  = selectedItems;
     ActualFilter        = rememberedFilter;
     if (rememberedFilter != null)
     {
         SetActualFilterToWindow();
     }
 }
 public MainWindow()
 {
     InitializeComponent();
     accountingBook   = new AccountingBook();
     LoadingAndSaving = new LoadAndSaveData();
     LoadingAndSaving.CheckAndLoadDataIfDbDirectoryExistElseCreate();
     accountingBook           = LoadingAndSaving.workingAccountingBook;
     DataContext              = accountingBook;
     ItemDataGrid.DataContext = accountingBook.AccountingBookItems;
     ItemDataGrid.ItemsSource = accountingBook.AccountingBookItems;
     SetSumTextBoxes();
 }
Ejemplo n.º 3
0
 public void SaveItemsAsCSVHelper(AccountingBook accountingBook)
 {
     try
     {
         using (StreamWriter sw = new StreamWriter(pathToCsvDatabaseData, false, Encoding.UTF8))
             using (var csv = new CsvWriter(sw, CultureInfo.InvariantCulture))
             {
                 csv.WriteRecords(accountingBook.AccountingBookItems);
             }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Chyba", MessageBoxButton.OK, MessageBoxImage.Exclamation);
     }
 }
Ejemplo n.º 4
0
 public AddItemWindow(AccountingBook accountingBook)
 {
     InitializeComponent();
     this.accountingBook = accountingBook;
     YearIntUpDown.Value = DateTime.Today.Year;
 }