private void DeleteButton_Click(object sender, RoutedEventArgs e) { GroupNumber grpno = (GroupNumber)dataGridgrpNo.SelectedItem; GroupNumberDataService groupNumberData = new GroupNumberDataService(new EntityFramework.TimetableManagerDbContext()); groupNumberData.DeleteGroupNumbers(grpno.Id).ContinueWith(result => { MessageBox.Show("Deleted"); }); _ = GroupNumberDataList.Remove(grpno); }
public async Task load() { GroupNumberDataService groupNumberDataService = new GroupNumberDataService(new EntityFramework.TimetableManagerDbContext()); GroupNumberList = await groupNumberDataService.GetGroupNumbers(); GroupNumberList.ForEach(e => { GroupNumber l = new GroupNumber(); l.Id = e.Id; l.GroupNum = e.GroupNum; GroupNumberDataList.Add(l); }); }