Exemple #1
0
        void client_SaveOtherDeviceCompleted(object sender, SaveOtherDeviceCompletedEventArgs e)
        {
            SystemMessages sm;

            if (e.Error == null)
            {
                ClearForm();
                sm = new SystemMessages(new Message()
                {
                    UserMessage = e.Result, SystemMessage = string.Empty, UserMessageType = MessageType.Success
                },
                                        ButtonType.OkOnly);
                System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("/Default.aspx#/Pages/Devices/OtherDevices.xaml", UriKind.Relative));
            }
            else
            {
                if (e.Error is FaultException <CustomServiceFault> )
                {
                    FaultException <CustomServiceFault> fault = e.Error as FaultException <CustomServiceFault>;
                    sm = new SystemMessages(new Message()
                    {
                        UserMessage = fault.Detail.UserMessage, SystemMessage = fault.Detail.SystemMessage, UserMessageType = MessageType.Error
                    },
                                            ButtonType.OkOnly);
                }
                else
                {
                    sm = new SystemMessages(new Message()
                    {
                        UserMessage = "Failed to Save Other Device Information", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error
                    },
                                            ButtonType.OkOnly);
                }
            }
            sm.ShowPopup();
        }
 void client_SaveOtherDeviceCompleted(object sender, SaveOtherDeviceCompletedEventArgs e)
 {
     SystemMessages sm;
     if (e.Error == null)
     {
         ClearForm();
         sm = new SystemMessages(new Message() { UserMessage = e.Result, SystemMessage = string.Empty, UserMessageType = MessageType.Success },
                 ButtonType.OkOnly);
         System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("/Default.aspx#/Pages/Devices/OtherDevices.xaml", UriKind.Relative));
     }
     else
     {
         if (e.Error is FaultException<CustomServiceFault>)
         {
             FaultException<CustomServiceFault> fault = e.Error as FaultException<CustomServiceFault>;
             sm = new SystemMessages(new Message() { UserMessage = fault.Detail.UserMessage, SystemMessage = fault.Detail.SystemMessage, UserMessageType = MessageType.Error },
                 ButtonType.OkOnly);
         }
         else
             sm = new SystemMessages(new Message() { UserMessage = "Failed to Save Other Device Information", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error },
                 ButtonType.OkOnly);
     }
     sm.ShowPopup();
 }