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); } }
bool InterfaceLandScape.AddLandScape(LandScape landScape) { LandScapeAPI landScapeAPI = new LandScapeAPI(); landScapeAPI.AddLandScape(landScape); return(true); }
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(); }
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]()); }
bool InterfaceLandScape.UpdateLandScape(LandScape landScape) { LandScapeAPI landScapeAPI = new LandScapeAPI(); return(landScapeAPI.UpdateLandScape(landScape.Id, landScape.LandScapeName, landScape.LandScapeDescription)); }