void client_GetCompanyListCompleted(object sender, GetCompanyListCompletedEventArgs e) { if (e.Error == null) { ListBoxCompanyList.ItemsSource = e.Result; if (ListBoxCompanyList.Items.Count > 0 && m_selectFirst) { ListBoxCompanyList.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 Company List", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error }, ButtonType.OkOnly); } sm.ShowPopup(); } }
void client_GetCompanyListCompleted(object sender, GetCompanyListCompletedEventArgs e) { if (e.Error == null) { ListBoxCompanyList.ItemsSource = e.Result; if (ListBoxCompanyList.Items.Count > 0 && m_selectFirst) { ListBoxCompanyList.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 Company List", SystemMessage = e.Error.Message, UserMessageType = MessageType.Error }, ButtonType.OkOnly); sm.ShowPopup(); } }
void client_GetCompanyListCompleted(object sender, GetCompanyListCompletedEventArgs e) { if (e.Error == null) { ComboBoxCompany.ItemsSource = e.Result; } if (ComboBoxCompany.Items.Count > 0) { ComboBoxCompany.SelectedIndex = 0; } }
void client_GetCompanyListCompleted(object sender, GetCompanyListCompletedEventArgs e) { if (e.Error == null) ComboBoxCompany.ItemsSource = e.Result; if (ComboBoxCompany.Items.Count > 0) ComboBoxCompany.SelectedIndex = 0; }