Example #1
0
        public void Execute()
        {
            DAOFactory         daoFactory    = DAOFactory.GetFactory(DAOFactory.Type.Postgres);
            PostgresCruiserDAO cruiserDao    = (PostgresCruiserDAO)daoFactory.GetCruiserDAO();
            CruiserMapper      cruiserMapper = MapperFactory.CreateCruiserMapper();

            _cruiserDTO = cruiserMapper.CreateDTO(cruiserDao.GetCruiser(_id));
        }
        public void Execute()
        {
            _cruiserDtoList = new List <CruiserDTO>();
            DAOFactory         daoFactory    = DAOFactory.GetFactory(DAOFactory.Type.Postgres);
            PostgresCruiserDAO cruiserDao    = (PostgresCruiserDAO)daoFactory.GetCruiserDAO();
            CruiserMapper      cruiserMapper = MapperFactory.CreateCruiserMapper();

            _cruiserDtoList = cruiserMapper.CreateDTOList(cruiserDao.GetCruisers());
        }
        public void Execute()
        {
            DAOFactory    daoFactory    = DAOFactory.GetFactory(DAOFactory.Type.Postgres);
            CruiserMapper cruiserMapper = MapperFactory.CreateCruiserMapper();
            Cruiser       cruiser       = cruiserMapper.CreateEntity(_cruiserDto);

            CommandFactory.CreateGetCruiserValidatorCommand(cruiser).Execute();
            _cruiserDto = cruiserMapper.CreateDTO(daoFactory.GetCruiserDAO().UpdateCruiser(cruiser));
        }
Example #4
0
        public void Execute()
        {
            DAOFactory         daoFactory    = DAOFactory.GetFactory(DAOFactory.Type.Postgres);
            PostgresCruiserDAO cruiserDao    = (PostgresCruiserDAO)daoFactory.GetCruiserDAO();
            CruiserMapper      cruiserMapper = MapperFactory.CreateCruiserMapper();
            Cruiser            cruiser       = (Cruiser)cruiserMapper.CreateEntity(_cruiserDTO);

            _cruiserDTO.Id = cruiserDao.AddCruiser(cruiser);
        }
 public void Setup()
 {
     _cruiser        = new Cruiser("The great seeker of wonder", true, 220, 200, "A big one", "A tender line", "I suppose a picture is in order");
     _cruiserMapper  = MapperFactory.CreateCruiserMapper();
     _cruiserDTOList = new List <CruiserDTO>();
     _cruiserList    = new List <Cruiser>();
     _layover        = new Layover(0, "02/12/2019", "05/01/2020", 250, 1, 2);
     _layoverMapper  = MapperFactory.CreateLayoverMapper();
     _layoverDTOList = new List <LayoverDTO>();
     _layoverList    = new List <Layover>();
 }