コード例 #1
0
 public void AddRoomStatus()
 {
     try
     {
         var roomStatus = new RoomStatus();
         Console.WriteLine("Print Status: ");
         roomStatus.Status = Console.ReadLine();
         if (!Validation.IsNullOrEmpty(roomStatus.Status) || !Validation.ValidateString(roomStatus.Status))
         {
             AddRoomStatus();
         }
         roomStatusService.AddRoomStatus(roomStatus);
         Console.WriteLine("Object successful added");
         ConsoleRoomStatusPresenter.Present(roomStatusService.ReadRoomStatuses());
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         AddRoomStatus();
     }
 }
コード例 #2
0
 public IEnumerable <RoomStatusViewModel> ReadRoomStatuses()
 {
     return(mapper.Map <IEnumerable <RoomStatusViewModel> >(roomStatusRepository.ReadRoomStatuses()));
 }