void client_GetVendorListCompleted(object sender, GetVendorListCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                ListBoxVendorList.ItemsSource = e.Result;
                if (ListBoxVendorList.Items.Count > 0 && m_selectFirst)
                {
                    ListBoxVendorList.SelectedIndex = 0;
                    m_selectFirst = false;
                }
            }
            else
            {
                SystemMessages sm;
                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 Retrieve Vendor List", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error },
                        ButtonType.OkOnly);

                sm.ShowPopup();
            }
        }
Exemple #2
0
 //void client_GetProtocolListCompleted(object sender, GetProtocolListCompletedEventArgs e)
 //{
 //    if (e.Error == null)
 //        ComboBoxProtocol.ItemsSource = e.Result;
 //    if (ComboBoxProtocol.Items.Count > 0)
 //        ComboBoxProtocol.SelectedIndex = 0;
 //}
 void client_GetVendorListCompleted(object sender, GetVendorListCompletedEventArgs e)
 {
     if (e.Error == null)
         ComboBoxVendor.ItemsSource = e.Result;
     if (ComboBoxVendor.Items.Count > 0)
         ComboBoxVendor.SelectedIndex = 0;
 }