public ActionResult HotelFeatureEdit(HotelFeaturesModel model) { if (ModelState.IsValid) { _serviceHotelFeatures.Update(model.ModelToEnity(true)); } return RedirectToAction("HotelFeatureList"); }
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(); } }
public ActionResult HotelFeatureInsert(HotelFeaturesModel model) { if (ModelState.IsValid) { _serviceHotelFeatures.Insert(model.ModelToEnity()); } return RedirectToAction("HotelFeatureList"); }