private void DoubleClick_Open(object sender, MouseButtonEventArgs e)
 {
     if (CompanyDataGrid.SelectedItem != null && invoiceOpen)
     {
         if (InvoiceCorrections.IsChecked != true)
         {
             Invoice        inv            = CompanyDataGrid.SelectedItem as Invoice;
             InvoiceDetails invoiceDetails = new InvoiceDetails(inv, inv.Id, inv.IdCompany);
             invoiceDetails.Show();
         }
         else
         {
             InvoiceCorrection    invoiceCorrection = CompanyDataGrid.SelectedItem as InvoiceCorrection;
             EditedInvoiceDetails edited            = new EditedInvoiceDetails(invoiceCorrection);
             edited.Show();
         }
     }
     else if (CompanyDataGrid.SelectedItem != null && StorageOpen)
     {
         Product prd = CompanyDataGrid.SelectedItem as Product;
         StorageAdditionalOperations storageAdditionalOperations = new StorageAdditionalOperations(prd);
         storageAdditionalOperations.Show();
         storageAdditionalOperations.Closed += (s, eventarg) =>
         {
             LoadProductsList();
         };
     }
     else
     {
         MessageBox.Show("Wybierz pozycję z listy!");
     }
 }
 private void show_Invoice(object sender, RoutedEventArgs e)
 {
     if (InvoicesListView.SelectedItem != null)
     {
         Invoice        inv            = InvoicesListView.SelectedItem as Invoice;
         InvoiceDetails invoiceDetails = new InvoiceDetails(inv, inv.Id, inv.IdCompany);
         invoiceDetails.Show();
     }
 }