private void listView_Selected(object sender, RoutedEventArgs e) { ListView seznam = (ListView)sender; lib jednoAuto = (lib)seznam.SelectedItem; Name.Text = jednoAuto.Name; Power.Text = jednoAuto.Power; string ManuInput = jednoAuto.Manu; string CondInput = jednoAuto.Cond; }
private void Button_Click_1(object sender, RoutedEventArgs e) { var databasePath = "MyData.db"; var conn = new SQLiteConnection(databasePath); lib item = (lib)listView.SelectedItem; conn.Delete(item); seznamAut.Remove(item); }
private void Button_Click(object sender, RoutedEventArgs e) { string NameInput = Name.Text; int PowerInput = Int32.Parse(Power.Text); string ManuInput = Manufacturer.Text; string CondInput = Cond.Text; lib auto = new lib() { Name = NameInput, Power = PowerInput, Cond = CondInput, Manu = ManuInput }; var databasePath = "MyData.db"; var db = new SQLiteConnection(databasePath); //ManuInput + " " +NameInput + " | " + PowerInput + " kW | " + CondInput seznamAut.Add(auto); lib.add(db, NameInput, PowerInput, CondInput, ManuInput); }