private void GetSearchList(string strSearchText) { try { if (string.IsNullOrEmpty(strSearchText)) { CustomerSearchList = null; IsPopupOpen = false; return; } Task.Factory.StartNew(() => { var customerActions = new CustomerAction(); CustomerSearchList = customerActions.GetCustomerSearchDictionary(this.DBConnectionString, strSearchText); IsPopupOpen = true; if (CustomerSearchList == null || !CustomerSearchList.Any()) { CustomerSearchList = new Dictionary <String, String>(); CustomerSearchList.Add(new KeyValuePair <string, string>("", "No records available")); } }); this.RaisePropertyChanged(() => CustomerSearchList); } catch (Exception exception) { NLogLogger.LogError(exception, TitleResources.Error, ExceptionResources.ExceptionOccured, ExceptionResources.ExceptionOccuredLogDetail); } }
private void GetSearchList(string strSearchText) { try { if (string.IsNullOrEmpty(strSearchText)) { CustomerSearchList = null; IsPopupOpen = false; return; } Task.Factory.StartNew(() => { var customerActions = new CustomerAction(); CustomerSearchList = customerActions.GetCustomerSearchDictionary(this.DBConnectionString, strSearchText); IsPopupOpen = true; if (CustomerSearchList == null || !CustomerSearchList.Any()) { CustomerSearchList = new Dictionary<String, String>(); CustomerSearchList.Add(new KeyValuePair<string, string>("", "No records available")); } }); this.RaisePropertyChanged(() => CustomerSearchList); } catch (Exception exception) { NLogLogger.LogError(exception, TitleResources.Error, ExceptionResources.ExceptionOccured, ExceptionResources.ExceptionOccuredLogDetail); } }