private void Remove_User(object sender, RoutedEventArgs e)
 {
     if (invoiceOpen)
     {
         if (CompanyDataGrid.SelectedItem != null)
         {
             SQLiteDataAccess.DeleteInvoice((Invoice)CompanyDataGrid.SelectedItem);
             invoices.Remove((Invoice)CompanyDataGrid.SelectedItem);
             LoadInvoicesList();
         }
     }
     if (StorageOpen)
     {
         if (CompanyDataGrid.SelectedItem != null)
         {
             SQLiteDataAccess.DeleteProduct((Product)CompanyDataGrid.SelectedItem);
             products.Remove((Product)CompanyDataGrid.SelectedItem);
             LoadProductsList();
         }
     }
     if (SettlementsOpen)
     {
     }
     if (ContractorsOpen)
     {
         if (CompanyDataGrid.SelectedItem != null)
         {
             SQLiteDataAccess.DeleteContractors((Seller)CompanyDataGrid.SelectedItem);
             sellers.Remove((Seller)CompanyDataGrid.SelectedItem);
             LoadSellersList();
         }
     }
     if (StatmentsOpen)
     {
     }
 }
示例#2
0
        private void AddInvoice_Click(object sender, RoutedEventArgs e)
        {
            int    num             = SQLiteDataAccess.LoadAiCompanyId("Database_for_invoices")[0] + 1;
            int    idSeller        = Int32.Parse(IdSeller.Text);
            int    idCompany       = Int32.Parse(IdCompany.Text);
            string creationDate    = CreationDate.Text;
            string saleDate        = SaleDate.Text;
            string paymentType     = PaymentTypeComboBox.Text;
            string paymentDeadline = PaymentDeadline.Text;
            string toPay           = ToPay.Text;
            string toPayInWord     = ToPayInWord.Text;
            string paid            = Paid.Text;
            string dateOfIssue     = DateOfIssue.Text;
            string nameOfService   = NameOfService.Text;

            string[] date          = creationDate.Split('.');
            string   number        = num.ToString() + "." + date[1] + "." + date[2];
            string   accountNumber = AccountNumber.Text;
            Invoice  invoice       = new Invoice(idSeller, idCompany, number, creationDate, saleDate, paymentType, paymentDeadline, toPay,
                                                 toPayInWord, paid, dateOfIssue, nameOfService, accountNumber);

            SQLiteDataAccess.SaveInvoice(invoice);
            this.Close();
        }
 public ListOfInvoices()
 {
     loadedInvoices = SQLiteDataAccess.LoadInvoices();
     InitializeComponent();
     InvoicesListView.ItemsSource = loadedInvoices;
 }
 private void LoadCompaniesList()
 {
     companies = SQLiteDataAccess.LoadUsers();
     WiredUpCompaniesList();
 }
 private void LoadProductsList()
 {
     products = SQLiteDataAccess.LoadProducts(companyID);
     WiredUpProductList();
 }
 private void LoadSellersList()
 {
     sellers = SQLiteDataAccess.LoadSellers();
     WiredUpSellersList();
 }
 private void LoadStorageList()
 {
     storage = SQLiteDataAccess.LoadOperations();
     WiredUpStorageList();
 }
 private void LoadCorrectionList()
 {
     invoiceCorrections = SQLiteDataAccess.LoadCorrection();
     WiredUpCorrectionList();
 }