public int CreateRoom(RoomModel rm)
        {
            int result = DaoUtilities.NO_CHANGES;

            ROOM r = db.ROOM.Create();

            r.ROOM_ID = rm.RoomId;
            r.ROOM_NAME = rm.Name;
            r.ROOM_SUPERFICY = rm.Superficy;
            r.ROOM_MAXNBR = rm.MaxNb;

            db.ROOM.Add(r);
            try
            {
                int saveResult = db.SaveChanges();

                if (saveResult == 1)
                    result = DaoUtilities.SAVE_SUCCESSFUL;
            }
            catch (DbUpdateConcurrencyException e)
            {
                Console.WriteLine(e.GetBaseException().ToString());
                result = DaoUtilities.UPDATE_CONCURRENCY_EXCEPTION;
            }
            catch (DbUpdateException e)
            {
                Console.WriteLine(e.GetBaseException().ToString());
                result = DaoUtilities.UPDATE_EXCEPTION;
            }
            catch (DbEntityValidationException e)
            {
                Console.WriteLine(e.GetBaseException().ToString());
                result = DaoUtilities.ENTITY_VALIDATION_EXCEPTION;
            }
            catch (NotSupportedException e)
            {
                Console.WriteLine(e.GetBaseException().ToString());
                result = DaoUtilities.UNSUPPORTED_EXCEPTION;
            }
            catch (ObjectDisposedException e)
            {
                Console.WriteLine(e.GetBaseException().ToString());
                result = DaoUtilities.DISPOSED_EXCEPTION;
            }
            catch (InvalidOperationException e)
            {
                Console.WriteLine(e.GetBaseException().ToString());
                result = DaoUtilities.INVALID_OPERATION_EXCEPTION;
            }
            return result;
        }
        /// <summary>
        /// Convert a room from the database to a RoomModel
        /// </summary>
        /// <param name="r"></param>
        /// <returns></returns>
        public RoomModel ConvertRoomToRoomModel(ROOM r)
        {
            RoomModel rm = new RoomModel();

            if (r != null)
            {
                rm.RoomId = r.ROOM_ID;
                rm.Name = r.ROOM_NAME;
                rm.Superficy = r.ROOM_SUPERFICY;
                rm.MaxNb = r.ROOM_MAXNBR;
            }
            else
                rm = null;

            return rm;
        }
        public int DeleteRoom(RoomModel rm)
        {
            int result = DaoUtilities.NO_CHANGES;

            ROOM r = db.ROOM.Find(rm.RoomId);

            if (r != null)
            {
                db.ROOM.Remove(r);
                try
                {
                    int saveResult = db.SaveChanges();

                    if (saveResult == 1)
                        result = DaoUtilities.SAVE_SUCCESSFUL;
                }
                catch (DbUpdateConcurrencyException e)
                {
                    Console.WriteLine(e.GetBaseException().ToString());
                    result = DaoUtilities.UPDATE_CONCURRENCY_EXCEPTION;
                }
                catch (DbUpdateException e)
                {
                    Console.WriteLine(e.GetBaseException().ToString());
                    result = DaoUtilities.UPDATE_EXCEPTION;
                }
                catch (DbEntityValidationException e)
                {
                    Console.WriteLine(e.GetBaseException().ToString());
                    result = DaoUtilities.ENTITY_VALIDATION_EXCEPTION;
                }
                catch (NotSupportedException e)
                {
                    Console.WriteLine(e.GetBaseException().ToString());
                    result = DaoUtilities.UNSUPPORTED_EXCEPTION;
                }
                catch (ObjectDisposedException e)
                {
                    Console.WriteLine(e.GetBaseException().ToString());
                    result = DaoUtilities.DISPOSED_EXCEPTION;
                }
                catch (InvalidOperationException e)
                {
                    Console.WriteLine(e.GetBaseException().ToString());
                    result = DaoUtilities.INVALID_OPERATION_EXCEPTION;
                }
            }

            return result;
        }