public List<Room> GetRoomList()
        {
            List<Room> rooms = new List<Room>();

            SqlConnection connection = new SqlConnection(connectionString);

            string query = "SELECT * FROM Room";

            connection.Open();

            SqlCommand command = new SqlCommand(query, connection);

            SqlDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                Room room=new Room();

                room.Id = int.Parse(reader["Id"].ToString());

                room.RoomNo = int.Parse(reader["RoomNo"].ToString());

                room.CategoryId = int.Parse(reader["CategoryId"].ToString());

                room.Description = reader["Description"].ToString();

               rooms.Add(room);
            }

            reader.Close();
            connection.Close();

            return rooms;
        }
        public string Insert(Room room)
        {
            if (room.RoomNo.ToString() == "")
            {
                return "Enter a room no ";
            }

            else if (room.CategoryId.ToString()=="")
            {
                return "Select a category";
            }

            else if (roomGateway.HasThisRoomExists(room.RoomNo))
            {
                return "Room number must be unique";
            }

            else
            {
                int value = roomGateway.Insert(room);

                if (value > 0)
                {
                    return "Room Saved Successfully";
                }
                else
                {
                    return "Operation Failed";
                }
            }
        }
        public int Insert(Room room)
        {
            SqlConnection connection=new SqlConnection(connectionString);

            string query = "INSERT INTO Room VALUES('"+room.RoomNo+"','"+room.CategoryId+"','"+room.Description+"')";

            SqlCommand command=new SqlCommand(query,connection);

            connection.Open();
            int rowsAffected = command.ExecuteNonQuery();

            connection.Close();
            return rowsAffected;
        }