private void click(object sender, SelectionChangedEventArgs e) { Osoby osoba = (Osoby)ToDoItemsListView.SelectedItems[0]; //textBox.Text = osoba.Text; Detail customization = new Detail(osoba); customization.Show(); this.Close(); }
private void change_Click(object sender, RoutedEventArgs e) { Osoby item = new Osoby(); item.ID = _osoba.ID; item.FirstName = namech.Text; item.LastName = textch.Text; Database.SaveItemAsync(item); }
public Task <int> SaveItemAsync(Osoby item) { if (item.ID != 0) { return(database.UpdateAsync(item)); } else { return(database.InsertAsync(item)); } }
private void Add_Click(object sender, RoutedEventArgs e) { /* Osoby item = new Osoby(); * item.Name = "Vojtosaurus"; * item.Text = textBox.Text; * item.Done = 0; * Database.SaveItemAsync(item); */ if (string.IsNullOrEmpty(FirstName.Text) & string.IsNullOrEmpty(LastName.Text) & string.IsNullOrEmpty(LifeNumber.Text)) { Text.Content = "Zadej data správně"; } else { double num; if (double.TryParse(LifeNumber.Text, out num)) { Osoby item = new Osoby(); item.FirstName = FirstName.Text; item.LastName = LastName.Text; item.LifeNumber = LifeNumber.Text; DateTime datumCas = DateTime.Now; item.Date = datumCas; item.Sex = Man.Content.ToString(); item.Done = 0; Database.SaveItemAsync(item); var itemsFromDb = Database.GetItemsNotDoneAsync().Result; ItemsCount.Content = "Items in Database " + itemsFromDb.Count; ToDoItemsListView.ItemsSource = itemsFromDb; Text.Content = "Uloženo"; } else { Text.Content = "LifeNumber inst number"; } } }
public Detail(Osoby osoba) { InitializeComponent(); detail.Content = "ID: " + osoba.ID + " Jméno: " + osoba.FirstName + " Přijmení: " + osoba.LastName + " Datum vytvoření " + osoba.Date; this._osoba = osoba; }
public Task <int> DeleteItemAsync(Osoby item) { return(database.DeleteAsync(item)); }