コード例 #1
0
        private void DeleteSelectedParty()
        {
            try
            {
                if (partyDataGrid.SelectedItems.Count == 0)
                {
                    throw (new Exception("Please select an item to delete"));
                }

                PartyService.PartySummary partySummary =
                    (PartyService.PartySummary)partyDataGrid.SelectedItem;

                MessagePopUp confirmDelete = new MessagePopUp(
                    string.Format("Are you sure you want to delete [{0}]?", partySummary.Name),
                    MessagePopUp.MessagePopUpType.YesNo);

                confirmDelete.Closed += ConfirmDeleteHandler;

                confirmDelete.Show();
            }
            catch (Exception ex)
            {
                formBusyIndicator.IsBusy = false;
                app.ShowError(ex.Message);
            }
        }
コード例 #2
0
        private void ConfirmDeleteHandler(object sender, EventArgs e)
        {
            try
            {
                CheckBusyAskCancel();

                formBusyIndicator.IsBusy = true;

                if (partyDataGrid.SelectedItems.Count == 0)
                {
                    throw (new Exception("Please select an item to delete"));
                }

                PartyService.PartySummary partySummary =
                    (PartyService.PartySummary)partyDataGrid.SelectedItem;

                string action =
                    string.Format("party/{0}/delete", partySummary.Id);

                this.webClient = app.ServiceDelete(action, DeleteCompleted);
            }
            catch (Exception ex)
            {
                formBusyIndicator.IsBusy = false;
                app.ShowError(ex.Message);
            }
        }
コード例 #3
0
 private void editPartyButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         formBusyIndicator.IsBusy = true;
         Button cellButton = (Button)e.OriginalSource;
         PartyService.PartySummary partySummary = (PartyService.PartySummary)cellButton.Tag;
         LoadParty(partySummary);
     }
     catch (Exception ex)
     {
         formBusyIndicator.IsBusy = false;
         app.ShowError(ex.Message);
     }
 }
コード例 #4
0
        private void LoadParty(PartyService.PartySummary partySummary)
        {
            try
            {
                formBusyIndicator.IsBusy = true;

                CheckBusyAskCancel();

                this.webClient = app.ServiceGet(
                    string.Format("party/{0}", partySummary.Id), PartyLoadCompleted);
            }
            catch (Exception ex)
            {
                formBusyIndicator.IsBusy = false;
                MessageBox.Show(ex.Message, "Loading", MessageBoxButton.OK);
            }
        }