示例#1
0
        public void FillAboutHotel(AboutHotelModel aboutHotel)
        {
            var account = RootRepository.AccountRepository.GetCurrentLoggedInAccount();
            var hotel   = account.Hotels.FirstOrDefault();

            if (hotel == null || hotel.HotelDetail == null)
            {
                return;
            }

            aboutHotel.Description = hotel.HotelDetail.Description;
            aboutHotel.Logo        = hotel.HotelDetail.LogoImage != null ? new ImageModel(hotel.HotelDetail.LogoImage) : null;
        }
示例#2
0
        public void UpdateAboutHotel(AboutHotelModel model)
        {
            var account = RootRepository.AccountRepository.GetCurrentLoggedInAccount();
            var hotel   = account.Hotels.FirstOrDefault();

            //TODO: JD: Throw Error
            if (hotel == null || hotel.HotelDetail == null)
            {
                return;
            }

            var logo = model.Logo != null?Rp.ExecuteAction(() => (from cI in Context.Images
                                                                  where cI.PKID == model.Logo.PKID
                                                                  select cI)).FirstOrDefault() : null;

            if (logo != null)
            {
                hotel.HotelDetail.LogoImage = logo;
            }

            hotel.HotelDetail.Description = model.Description;

            Context.LogValidationFailSaveChanges(RootRepository.SecurityRepository.AuditLogUserId);
        }