private async void showArtwork(int?ArtTypeID)
        {
            //Show Progress
            progRing.IsActive   = true;
            progRing.Visibility = Visibility.Visible;

            ArtworkRepository r = new ArtworkRepository();

            try
            {
                List <Artwork> artworks;
                if (ArtTypeID.GetValueOrDefault() > 0)
                {
                    artworks = await r.GetArtworksByArtType(ArtTypeID.GetValueOrDefault());
                }
                else
                {
                    artworks = await r.GetArtworks();
                }
                patientList.ItemsSource = artworks.OrderByDescending(e => e.ID);
            }
            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("server"))
                {
                    Jeeves.ShowMessage("Error", "No connection with the server.");
                }
                else
                {
                    Jeeves.ShowMessage("Error", "Could not complete operation.");
                }
            }
            finally
            {
                progRing.IsActive   = false;
                progRing.Visibility = Visibility.Collapsed;
            }
        }
Exemple #2
0
        public ActionResult Index()
        {
            var artWorks = _artWorkRepository.GetArtworks();

            return(View(artWorks));
        }