コード例 #1
0
        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();
            }
        }
コード例 #2
0
 public ActionResult RoomFeaturesEdit(RoomFeaturesModel roomFeatures)
 {
     RoomFeatures roomfeatures = roomFeatures.ModelToEnity();
     roomfeatures.IsActive = true;
     _serviceRoomFeatures.Update(roomfeatures);
     return RedirectToAction("RoomFeaturesList");
 }
コード例 #3
0
 public ActionResult RoomFeatureInsert(RoomFeaturesModel roomModel)
 {
     RoomFeatures room = roomModel.ModelToEnity();
     room.IsActive = true;
     _serviceRoomFeatures.Insert(room);
     return RedirectToAction("RoomFeaturesList");
 }