public static RoomFeaturesModel EntityToModel(this RoomFeatures entity, bool virtualActive = false) { try { RoomFeaturesModel model = new RoomFeaturesModel() { Name=entity.Name, IsActive = entity.IsActive, Id = entity.Id }; if (virtualActive) { model.RoomFeaturesRoomTypes = entity.RoomFeaturesRoomTypes; } return model; } catch (Exception) { return new RoomFeaturesModel(); } }
public ActionResult RoomFeaturesEdit(RoomFeaturesModel roomFeatures) { RoomFeatures roomfeatures = roomFeatures.ModelToEnity(); roomfeatures.IsActive = true; _serviceRoomFeatures.Update(roomfeatures); return RedirectToAction("RoomFeaturesList"); }
public ActionResult RoomFeatureInsert(RoomFeaturesModel roomModel) { RoomFeatures room = roomModel.ModelToEnity(); room.IsActive = true; _serviceRoomFeatures.Insert(room); return RedirectToAction("RoomFeaturesList"); }