private void Button_Click(object sender, RoutedEventArgs e)
        {
            SQLiteConnection sqliteCon = new SQLiteConnection(dbConnectionString);


            try
            {
                sqliteCon.Open();
                if (datapic1.Text == "" || datapic2.Text == "")                 //|| textbox3.Text == "" || textbox4.Text == "" || cmb1.Text =="")
                {
                    MessageBox.Show("Bitte Datum ausfüllen ");
                }
                else
                {
                    //string Query = " SELECT Buchung_nummer fROM Buchen";
                    //string Query = " SELECT Buchung_nummer, Name , Vorname, Geburtsdatum , type , Preis_zimmer from Buchung,Kunden,Zimmer WHERE Buchung.Kunden_id = Kunden.Kunden_id And Buchung.Zimmer_id = Zimmer.Zimmer_id  ";
                    //string Query = " SELECT Buchung_nummer, Name , Vorname, Geburtsdatum , type , Preis_zimmer from Buchung,Kunden,Zimmer WHERE Von between '" +datapicke1.ToString()+ "' AND Bis'" + datapik2.ToString() + "' And Buchung.Kunden_id = Kunden.Kunden_id And Buchung.Zimmer_id = Zimmer.Zimmer_id And Buchung.Zimmer_id = Zimmer.Zimmer_id";
                    string Query = " SELECT Buchung_nummer,Name , Vorname, Von, Bis, Datum , Preis   FROM Buchung ,Kunden WHERE Von between '" + datapic1.ToString() + "'and   '" + datapic2.ToString() + "' And Buchung.Kunden_id = Kunden.Kunden_id ";
                    //string Query = "SELECT * FROM Buchung JOIN Kunden , Zimmer ON Buchung.Kunden_id = Kunden.Kunden_id And Buchung.Zimmer_id = Zimmer.Zimmer_id WHERE Buchung_nummer = @Buchungsnummer";
                    //string Query = " SELECT Buchung_nummer from Buchung";
                    SQLiteCommand     CreateCommand = new SQLiteCommand(Query, sqliteCon);
                    SQLiteDataAdapter dataAdapter   = new SQLiteDataAdapter(CreateCommand);
                    Zimmer_verwalten  ds            = new Zimmer_verwalten();
                    SQLiteDataReader  reader;
                    reader = CreateCommand.ExecuteReader();
                    dataGrid.ItemsSource = reader;
                    //sqliteCon.Close();
                    //DataTable dt = new DataTable();
                    //dataAdapter.Fill(dt);
                    //dataGrid.DataSource = dt;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #2
0
        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            Zimmer_verwalten win2 = new Zimmer_verwalten();

            win2.Show();
        }
        private void btn_zimmer(object sender, RoutedEventArgs e)
        {
            Zimmer_verwalten win2 = new Zimmer_verwalten();

            win2.Show();
        }