public RoomStatusViewModel AddRoomStatus(RoomStatusViewModel model)
        {
            var roomStatuModel = mapper.Map <RoomStatus>(model);
            var roomStatus     = roomStatusRepository.AddRoomStatus(roomStatuModel);

            return(mapper.Map <RoomStatusViewModel>(roomStatus));
        }
Beispiel #2
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();
     }
 }