コード例 #1
0
        /// <summary>
        /// Uploads photo asynchronous.
        /// </summary>
        /// <param name="swapPhoto">The swap photo.</param>
        /// <param name="personBase">The person base.</param>
        /// <param name="photo">The byte array of photo.</param>
        /// <param name="gangwayEventType">Type of the gangway event.</param>
        /// <returns>
        /// Upload media Items.
        /// </returns>
        public async Task UploadPhotosAsync(SwapPhoto swapPhoto, PersonBase personBase, byte[] photo, GangwayEventType gangwayEventType)
        {
            var person = personBase != null ? personBase : new PersonBase
        {
                PersonId = swapPhoto.PersonId,
                PersonType = swapPhoto.PersonType,
                PersonTypeId = swapPhoto.PersonTypeId,
                CruiseDetail = new GuestCruiseDetail { VoyageId = swapPhoto.VoyageId },
                LinkId = swapPhoto.LinkId
            };

            var personEvent = CreateEventService.MapPersonEvent(person, null, gangwayEventType, null, null, null, null);
            await GangwayRepositoryFactory.Retrieve().UploadPhotosAsync(person, photo, personEvent);
        }
コード例 #2
0
        /// <summary>
        /// Adds the photos to cart.
        /// </summary>
        /// <param name="photo">The swap photo.</param>
        public void AddPhotosToCart(SwapPhoto photo)
        {
            if (!this.SwapPhotos.ToList().Exists(p => p.PersonId.Equals(photo.PersonId)))
            {
                this.SwapPhotos.Add(photo);
                UpdateUI(IsPhotoInCart, !IsCancelPressed);
            }
            else
            {
                if (this.SwapPhotos.Count != 2)
                {
                    this.SwapPhotos.Remove(this.SwapPhotos.Where(s => s.PersonId == photo.PersonId).Select(p => p).FirstOrDefault());
                    UpdateUI(!IsPhotoInCart, !IsCancelPressed);
                }
            }

            this.NumberOfPhotosAddedToCart = this.SwapPhotos.Count();
        }
コード例 #3
0
        /// <summary>
        /// Adds the guest photo.
        /// </summary>
        private void AddGuestPhoto()
        {
            SwapPhoto swapPhoto = new SwapPhoto()
            {
                PersonId = this.currentParty.SelectedPerson.PersonId,
                PersonType = this.currentParty.SelectedPerson.PersonType,
                PersonPhoto = this.CurrentParty.SelectedPerson.Photo,
                FirstName = this.CurrentParty.SelectedPerson.PersonalDetail.FirstName,
                LastName = this.CurrentParty.SelectedPerson.PersonalDetail.LastName,
                VoyageId = this.CurrentParty.SelectedPerson.CruiseDetail.VoyageId,
                PersonTypeId = this.CurrentParty.SelectedPerson.PersonTypeId,
                LinkId = this.CurrentParty.SelectedPerson.LinkId
            };

            swapPhoto.AssignPhotoByteArray(this.CurrentParty.SelectedPerson.PhotoByteArray);
            SwapPhotoManager.Instance.AddPhotosToCart(swapPhoto);

            if (SwapPhotoManager.Instance.NumberOfPhotosAddedToCart == 2)
            {
                Messenger.Instance.Notify(MessengerMessage.ShowSwapGuestPhotoView);
            }
        }