Exemplo n.º 1
0
        Guid IHotelManagementRepository.UpdateHotelInformation(HotelDetailsModel model)
        {
            var entity = new HotelDetails()
            {
                HotelName      = model.HotelName,
                CompanyName    = model.CompanyName,
                BusinessNumber = model.BusinessNumber,
                DateTime       = DateTime.UtcNow
            };

            Context.HotelDetails.Add(entity);
            Context.SaveChanges();
            return(entity.Id);
        }
        public bool UpdateHotelDetails(HotelSetupViewModel viewModel)
        {
            var hotelDetailsModel = new HotelDetailsModel()
            {
                HotelName      = viewModel.HotelName,
                CompanyName    = viewModel.CompanyName,
                BusinessNumber = Convert.ToInt32(viewModel.BusinessNumber),
            };

            Repository.UpdateHotelInformation(hotelDetailsModel);

            var contactDetailsModel = new ContactDetailsModel()
            {
                Taxid           = viewModel.Taxid,
                TelephoneNumber = viewModel.Telephone,
                FaxNumber       = viewModel.FaxNumber,
                EmailAddress    = viewModel.EmailAddress,
                CountryCode     = viewModel.CountryCode,
                PostalCode      = viewModel.PostalCode,
            };

            Repository.UpdateContactInformation(contactDetailsModel);

            var addressDetailsModel = new AddressDetailsModel()
            {
                Address  = viewModel.Address,
                City     = viewModel.City,
                CityCode = viewModel.CityCode,
                State    = viewModel.State,
            };

            Repository.UpdateAddressInformation(addressDetailsModel);

            var logoDetailsModel = new LogoDetailsModel()
            {
                Website  = viewModel.Website,
                Logo     = viewModel.Logo,
                Skype    = viewModel.Skype,
                Language = viewModel.Language,
            };

            Repository.UpdateLogoInformation(logoDetailsModel);
            return(true);
        }
Exemplo n.º 3
0
        // GET: HotelDetails/Details/5
        public ActionResult Details(int id)
        {
            //Display Active Hotel
            ViewBag.isActive = UtilContants.HOTELS_NAV;

            var hotel            = new HotelDetailsModel();
            var listHotelDetails = hotel.listHotelDetails(id);
            var image            = hotel.listImage(id);
            var listComboBoxCity = hotel.listComboBoxCity();
            var listHotelHot     = hotel.listHotelHot(id);
            var listConvenient   = hotel.getListConvenient(id);

            // delare ListContainerHotelDetails to container listImage and listHotelDetails
            ListContainerHotelDetails listContainer = new ListContainerHotelDetails();

            listContainer.HotelDetails = listHotelDetails;
            listContainer.Image        = image;
            listContainer.ComboBoxCity = listComboBoxCity;
            listContainer.HotelHot     = listHotelHot;
            listContainer.Convenient   = listConvenient;
            return(View(listContainer));
        }