private async void fillDropDown() { //Show Progress progRing.IsActive = true; progRing.Visibility = Visibility.Visible; ArtTypeRepository r = new ArtTypeRepository(); try { List <ArtType> artTypes = await r.GetArtType(); //Add the All Option artTypes.Add(new ArtType { ID = 0, Type = " - All Art Types" }); //Save them for the Patient Details App thisApp = Application.Current as App; thisApp.allTypes = artTypes; //Bind to the ComboBox ArtTypeCombo.ItemsSource = artTypes.OrderBy(at => at.Type); btnAdd.IsEnabled = true; //Since we have doctors, you can try to add new. showArtWorks(null); } catch (ApiException apiEx) { var sb = new StringBuilder(); sb.AppendLine("Errors:"); foreach (var error in apiEx.Errors) { sb.AppendLine("-" + error); } Jeeves.ShowMessage("Could not complete operation:", sb.ToString()); progRing.IsActive = false; progRing.Visibility = Visibility.Collapsed; } catch (Exception ex) { if (ex.InnerException.Message.Contains("connection with the server")) { Jeeves.ShowMessage("Error", "No connection with the server. Check that the Web Service is running and available and then click the Refresh button."); } else { Jeeves.ShowMessage("Error", "Could not complete operation."); } progRing.IsActive = false; progRing.Visibility = Visibility.Collapsed; } }
private async void fillDropDown() { ArtTypeRepository r = new ArtTypeRepository(); try { List <ArtType> artTypes = await r.GetArtType(); //Add the All Option artTypes.Add(new ArtType { ID = 0, Type = " - All Art Types" }); //Save them for the Patient Details App thisApp = Application.Current as App; thisApp.allTypes = artTypes; //Bind to the ComboBox ArtTypeCombo.ItemsSource = artTypes.OrderBy(at => at.Type); } catch (ApiException apiEx) { var sb = new StringBuilder(); sb.AppendLine("Errors:"); foreach (var error in apiEx.Errors) { sb.AppendLine("-" + error); } Jeeves.ShowMessage("Could not complete operation:", sb.ToString()); } catch (Exception ex) { if (ex.InnerException.Message.Contains("connection with the server")) { Jeeves.ShowMessage("Error", "No connection with the server. Check that the Web Service is running and available and then click the Refresh button."); } else { Jeeves.ShowMessage("Error", "Could not complete operation."); } } }
public ArtTypeController(ArtTypeRepository artTypeRepository) : base(artTypeRepository) { }