示例#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 DeleteCompleted(object sender, UploadStringCompletedEventArgs e)
        {
            try
            {
                CheckForErrors(e);

                string returnTypeName = app.GetBusinessObjectType(e.Result);

                switch (returnTypeName)
                {
                case "Acknowledgement":
                    PartyService.Acknowledgement ack = app.LoadBusinessObject <PartyService.Acknowledgement>(e.Result);
                    MessagePopUp ackPopUp            = new MessagePopUp(ack.Message, MessagePopUp.MessagePopUpType.OK);
                    ackPopUp.Show();
                    break;

                case "Error":
                    PartyService.Error err = app.LoadBusinessObject <PartyService.Error>(e.Result);
                    throw (new Exception(err.Message));

                default:
                    throw (new Exception("Unrecognised object type in server response"));
                }
            }
            catch (Exception ex)
            {
                app.ShowError(ex.Message);
            }
            finally
            {
                formBusyIndicator.IsBusy = false;
            }
        }
        private void DeleteCompleted(object sender, UploadStringCompletedEventArgs e)
        {
            try
            {
                CheckForErrors(e);

                string returnTypeName = app.GetBusinessObjectType(e.Result);

                switch (returnTypeName)
                {
                    case "Acknowledgement":
                        PartyService.Acknowledgement ack = app.LoadBusinessObject<PartyService.Acknowledgement>(e.Result);
                        MessagePopUp ackPopUp = new MessagePopUp(ack.Message, MessagePopUp.MessagePopUpType.OK);
                        ackPopUp.Show();
                        break;
                    case "Error":
                        PartyService.Error err = app.LoadBusinessObject<PartyService.Error>(e.Result);
                        throw (new Exception(err.Message));
                    default:
                        throw (new Exception("Unrecognised object type in server response"));
                }

            }
            catch (Exception ex)
            {
                app.ShowError(ex.Message);
            }
            finally
            {
                formBusyIndicator.IsBusy = false;
            }
        }
 protected void Cancel()
 {
     if (this.isDirty)
     {
         MessagePopUp mpu = new MessagePopUp(
             "Changes have been made: do you want to save?",
             MessagePopUp.MessagePopUpType.YesNoCancel);
         mpu.Closed += CancelPopUpHandler;
         mpu.Show();
     }
     else
     {
         RevertContent();
     }
 }
示例#5
0
 protected void Cancel()
 {
     if (this.isDirty)
     {
         MessagePopUp mpu = new MessagePopUp(
             "Changes have been made: do you want to save?",
             MessagePopUp.MessagePopUpType.YesNoCancel);
         mpu.Closed += CancelPopUpHandler;
         mpu.Show();
     }
     else
     {
         RevertContent();
     }
 }
示例#6
0
        public void ShowError(string message)
        {
            MessagePopUp mpu = new MessagePopUp(message, MessagePopUp.MessagePopUpType.OK);

            mpu.Show();
        }
        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);
            }
        }