//Converted to string in the format "{Campus}-{Floor}-{Wing}-{RoomNumber}-{BedNumber}"
        public override string ToString()
        {
            string bed = Campus + "-";

            bed += Floor.ToString() + "-";
            bed += Wing + "-";
            bed += RoomNumber.ToString() + "-" + BedNumber.ToString();
            return(bed);
        }
예제 #2
0
        public override int GetHashCode()
        {
            int    hash    = 0;
            string hString = Cono + Unit + RoomNumber.ToString() + Bed;

            foreach (char c in hString)
            {
                hash += (int)c;
            }
            return(hash);
        }
예제 #3
0
 protected void ValidateRoomModel(out string message)
 {
     if (Capacity < 1 || !Regex.IsMatch(Capacity.ToString(), @"^\d{0,4}$"))
     {
         message = "Capacidade inválida";
     }
     else if (RoomNumber < 1 || !Regex.IsMatch(RoomNumber.ToString(), @"^\d{0,4}$"))
     {
         message = "Número da sala inválido";
     }
     else
     {
         message = String.Empty;
     }
 }
예제 #4
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder(100);

            sb.Append("Reservation: ");
            sb.Append("Room ");
            sb.Append(RoomNumber.ToString());
            sb.Append(", Check-in: ");
            sb.Append(CheckIn.ToString("dd/MM/yyyy"));
            sb.Append(", Check-out: ");
            sb.Append(CheckOut.ToString("dd/MM/yyyy"));
            sb.Append(", ");
            sb.Append(Duration().ToString());
            sb.Append(" nights.");
            return(sb.ToString());
        }
예제 #5
0
 public String FormattedRoomNumber()
 {
     return($"{RoomNumber.ToString("000")}");
 }
예제 #6
0
 public override string ToString()
 {
     return(RoomNumber.ToString());
 }
예제 #7
0
 public override string ToString()
 {
     return(",room number: " + RoomNumber.ToString());
 }