示例#1
0
        public ActionResult HotelAdd(EventPageHotelModel model)
        {
            //if (!_permissionService.Authorize(StandardPermissionProvider.ManageProducts))
            //    return AccessDeniedView();

            if (model == null)
            {
                throw new ArgumentException();
            }


            var entity = new EventPageHotel()
            {
                EventPageId           = model.EventPageId,
                Title                 = model.Title,
                Name                  = model.Name,
                Address1              = model.Address1,
                Address2              = model.Address2,
                City                  = model.City,
                State                 = model.State,
                ZipPostalCode         = model.ZipPostalCode,
                Country               = model.Country,
                PhoneNumber           = model.PhoneNumber,
                AdditionalInformation = model.AdditionalInformation,
                DisplayOrder          = model.DisplayOrder,
                DateCreated           = DateTime.Now,
                DateUpdated           = DateTime.Now,
            };


            _eventPageHotelService.Insert(entity);

            return(Json(new { Result = true }, JsonRequestBehavior.AllowGet));
        }
示例#2
0
        public ActionResult HotelUpdate(EventPageHotelModel model)
        {
            //if (!_permissionService.Authorize(StandardPermissionProvider.ManageProducts))
            //    return AccessDeniedView();

            var hotel = _eventPageHotelService.GetById(model.Id);

            if (hotel == null)
            {
                throw new ArgumentException("No hotel found with the specified id");
            }

            hotel.Name         = model.Name;
            hotel.DisplayOrder = model.DisplayOrder;
            hotel.DateUpdated  = DateTime.Now;

            _eventPageHotelService.Update(hotel);

            return(new NullJsonResult());
        }