private void addMemberButton_Click(object sender, RoutedEventArgs e) { var addMemberDialog = new AddMemberDialog(); if (addMemberDialog.ShowDialog() == true) { var newMember = addMemberDialog.NewMember; members.Add(newMember); memberListView.ItemsSource = null; memberListView.ItemsSource = members; } }
private void addMemberButton_Click(object sender, RoutedEventArgs e) { var addMemberDialog = new AddMemberDialog(); if (addMemberDialog.ShowDialog() == true) { var newMember = addMemberDialog.NewMember; trip.Members.Add(newMember); TripDAO.InsertMember(idTrip, newMember); DisplayDetail(); DisplayDonationChart(); } }
private void editMemberButton_MouseDown(object sender, MouseButtonEventArgs e) { var idMember = ((Image)sender).Uid; var memberCurrent = TripDAO.GetMemberById(idTrip, idMember); var addMemberDialog = new AddMemberDialog(memberCurrent); if (addMemberDialog.ShowDialog() == true) { var newMember = addMemberDialog.NewMember; TripDAO.RemoveMember(idTrip, idMember); TripDAO.InsertMember(idTrip, newMember); DisplayDetail(); DisplayDonationChart(); MessageBox.Show("Đã cập nhật thành công!"); } }