示例#1
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;
            }
        }
示例#2
0
        private void PingCompleted(object sender, OpenReadCompletedEventArgs e)
        {
            try
            {
                CheckForErrors(e);

                Stream s = e.Result;

                XmlSerializer xs = new XmlSerializer(typeof(PartyService.Acknowledgement));
                PartyService.Acknowledgement ack = (PartyService.Acknowledgement)xs.Deserialize(s);

                PartySearchForm partySearch = new PartySearchForm();

                SetContent(partySearch);
            }
            catch (Exception ex)
            {
                app.ShowError(ex.Message);
            }
            finally
            {
                formBusyIndicator.IsBusy = false;
            }
        }