Exemplo n.º 1
0
        private void UploadImage_Click(object sender, EventArgs e)
        {
            if (!(ImagePathValue.Text == ""))
            {
                int LandscapeId = myPhotoClient.GetIdByName(LandscapeComboBox.Text);
                int EventId     = myPhotoClient.GetIdByName(EventComboBox.Text);
                int LocationId  = myPhotoClient.GetIdByName(LocationComboBox.Text);

                LandScape landScape = myPhotoClient.GetLandScapeByName(LandscapeComboBox.Text);
                Event     @event    = myPhotoClient.GetEventByName(EventComboBox.Text);
                Location  location  = myPhotoClient.GetLocationByName(LocationComboBox.Text);
                Person    person    = myPhotoClient.GetPersonByName(PersonComboBox.Text.Substring(0, PersonComboBox.Text.IndexOf(" ")));
                string    isMovie   = "false";
                if (isMovieValue.Checked == true)
                {
                    isMovie = "true";
                }
                //photo = new Photo(ImagePathValue.Text, isMovie, "false");
                //photo = new Photo(EventId, LocationId, LandscapeId, ImagePathValue.Text, isMovie, "false");
                // photo = new Photo(person,@event, location, landScape, ImagePathValue.Text, isMovie, "false");
                photo = new Photo(ImagePathValue.Text, isMovie, "false", location, landScape, @event, person);
                // photo.Location = location;
                // photo.LandScape = landScape;
                // photo.Event = @event;
                // photo.Person = null;

                myPhotoClient.AddPhoto(photo);
            }
        }
Exemplo n.º 2
0
        bool InterfaceLandScape.AddLandScape(LandScape landScape)
        {
            LandScapeAPI landScapeAPI = new LandScapeAPI();

            landScapeAPI.AddLandScape(landScape);
            return(true);
        }
Exemplo n.º 3
0
        public async Task OnGetAsync()
        {
            var photos = await myPhotosClient.GetPhotosAsync();

            var locations = await myPhotosClient.GetLocationsAsync();

            var events = await myPhotosClient.GetEventsAsync();

            var landscapes = await myPhotosClient.GetLandScapesAsync();

            foreach (var item in photos)
            {
                PhotoDTO pd = new PhotoDTO();
                pd.Id          = item.Id;
                pd.FullPath    = item.FullPath;
                pd.EventId     = item.EventId;
                pd.LandScapeId = item.LandScapeId;
                pd.LocationId  = item.LocationId;



                Location location = await myPhotosClient.GetLocationByIdAsync(pd.LocationId);

                pd.LocationName = location.LocationName;

                Event @event = await myPhotosClient.GetEventByIdAsync(pd.EventId);

                pd.EventName = @event.EventName;

                LandScape landScape = await myPhotosClient.GetLandScapeByIdAsync(pd.LandScapeId);

                pd.LandScapeName = landScape.LandScapeName;

                Photos.Add(pd);



                //  Console.WriteLine("photo " + pd.FullPath);
            }

            if (!string.IsNullOrEmpty(SearchString))
            {
                searchForString();
            }
            sortPhotos();
            Count = Photos.Count();
        }
Exemplo n.º 4
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var photo = myPhotosClient.GetPhotoByIdAsync(id.Value);

            if (photo == null)
            {
                return(NotFound());
            }

            photoDTO.Id          = id.Value;
            photoDTO.isMovie     = photo.Result.isMovie;
            photoDTO.isRemoved   = photo.Result.isRemoved;
            photoDTO.EventId     = photo.Result.EventId;
            photoDTO.LandScapeId = photo.Result.LandScapeId;
            photoDTO.LocationId  = photo.Result.LocationId;

            LandScape landScape = await myPhotosClient.GetLandScapeByIdAsync(photoDTO.LandScapeId);

            photoDTO.LandScapeName = landScape.LandScapeName;
            string landscapeDescpritpion = landScape.LandScapeDescription;

            Location location = await myPhotosClient.GetLocationByIdAsync(photoDTO.LocationId);

            photoDTO.LocationName = location.LocationName;
            string locationDescription = location.LocationDescription;

            Event myEvent = await myPhotosClient.GetEventByIdAsync(photoDTO.EventId);

            photoDTO.EventName = myEvent.EventName;
            string eventDescription = myEvent.EventDescription;



            return(Page());
        }
 public static Transformer CreateInstance(LandScape landScape)
 {
     return(Creator[landScape]());
 }
Exemplo n.º 6
0
        bool InterfaceLandScape.UpdateLandScape(LandScape landScape)
        {
            LandScapeAPI landScapeAPI = new LandScapeAPI();

            return(landScapeAPI.UpdateLandScape(landScape.Id, landScape.LandScapeName, landScape.LandScapeDescription));
        }