コード例 #1
0
        public ActionResult HotelFeatureEdit(HotelFeaturesModel model)
        {
            if (ModelState.IsValid)
            {
                 _serviceHotelFeatures.Update(model.ModelToEnity(true));
            }

            return RedirectToAction("HotelFeatureList");
        }
コード例 #2
0
        public static HotelFeaturesModel EntityToModel(this HotelFeatures entity, bool virtualActive = false)
        {
            try
            {
                HotelFeaturesModel model = new HotelFeaturesModel()
                {
                    Name=entity.Name,
                    Content=entity.Content,
                    IsActive = entity.IsActive,
                    Id = entity.Id
                };
                if (virtualActive)
                {

                }
                return model;
            }
            catch (Exception)
            {

                return new HotelFeaturesModel();
            }
        }
コード例 #3
0
        public ActionResult HotelFeatureInsert(HotelFeaturesModel model)
        {
            if (ModelState.IsValid)
            {
                _serviceHotelFeatures.Insert(model.ModelToEnity());
            }

            return RedirectToAction("HotelFeatureList");
        }