Пример #1
0
        void client_SaveMeasurementCompleted(object sender, SaveMeasurementCompletedEventArgs e)
        {
            SystemMessages sm;

            if (e.Error == null)
            {
                ClearForm();
                //(Application.Current.RootVisual as MasterLayoutControl).UserControlSelectNode.RaiseNotification();
                sm = new SystemMessages(new Message()
                {
                    UserMessage = e.Result, SystemMessage = string.Empty, UserMessageType = MessageType.Success
                },
                                        ButtonType.OkOnly);
            }
            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 Measurement Information", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error
                    },
                                            ButtonType.OkOnly);
                }
            }
            sm.ShowPopup();

            App app = (App)Application.Current;

            if (m_deviceID > 0)
            {
                m_client.GetMeasurementsByDeviceAsync(m_deviceID);
            }
            else
            {
                m_client.GetMeasurementListAsync(app.NodeValue);
            }
        }
Пример #2
0
        void client_SaveMeasurementCompleted(object sender, SaveMeasurementCompletedEventArgs e)
        {
            SystemMessages sm;
            if (e.Error == null)
            {
                ClearForm();
                //(Application.Current.RootVisual as MasterLayoutControl).UserControlSelectNode.RaiseNotification();
                sm = new SystemMessages(new Message() { UserMessage = e.Result, SystemMessage = string.Empty, UserMessageType = MessageType.Success },
                        ButtonType.OkOnly);
            }
            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 Measurement Information", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error },
                        ButtonType.OkOnly);
            }
            sm.ShowPopup();

            App app = (App)Application.Current;
            if (m_deviceID > 0)
                m_client.GetMeasurementsByDeviceAsync(m_deviceID);
            else
                m_client.GetMeasurementListAsync(app.NodeValue);
        }