public void DeleteRoomType() { try { Console.WriteLine("Print Id: "); int id = Int32.Parse(Console.ReadLine()); roomTypeService.DeleteRoomType(id); Console.WriteLine("Object successful updated"); ConsoleRoomTypePresenter.Present(roomTypeService.ReadRoomTypes()); } catch (Exception ex) { Console.WriteLine(ex.Message); DeleteRoomType(); } }
public void AddRoomType() { try { var roomType = new RoomType(); Console.WriteLine("Print Status: "); roomType.Type = Console.ReadLine(); if (!Validation.IsNullOrEmpty(roomType.Type) || !Validation.ValidateString(roomType.Type)) { AddRoomType(); } roomTypeService.AddRoomType(roomType); Console.WriteLine("Object successful added"); ConsoleRoomTypePresenter.Present(roomTypeService.ReadRoomTypes()); } catch (Exception ex) { Console.WriteLine(ex.Message); AddRoomType(); } }
public void UpdateRoomType() { try { var roomType = new RoomType(); Console.WriteLine("Print Id: "); int id = Int32.Parse(Console.ReadLine()); Console.WriteLine("Print Type: "); roomType.Type = Console.ReadLine(); if (!Validation.IsNullOrEmpty(roomType.Type) || !Validation.ValidateString(roomType.Type)) { UpdateRoomType(); } roomTypeService.UpdateRoomType(id, roomType); Console.WriteLine("Object successful updated"); ConsoleRoomTypePresenter.Present(roomTypeService.ReadRoomTypes()); } catch (Exception ex) { Console.WriteLine(ex.Message); UpdateRoomType(); } }
public void ReadRoomType() { ConsoleRoomTypePresenter.Present(roomTypeService.ReadRoomTypes()); }