コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
        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!");
            }
        }