public Task <int> SaveZnamkaAsync(Znamka item) { if (item.ID != 0) { return(database.UpdateAsync(item)); } else { return(database.InsertAsync(item)); } }
private void btnAddGrade_Click(object sender, RoutedEventArgs e) { Znamka z = new Znamka(); z.IDStudent = student.ID; z.IDPredmet = listPredmet[cBoxSubject.SelectedIndex].ID; z.Hodnota = int.Parse(cBoxGrade.SelectionBoxItem.ToString()); App.Databaze.SaveZnamkaAsync(z); listZnamka.Add(z); cBoxGrade.SelectedItem = null; cBoxSubject.SelectedItem = null; }