public Plataform GetPlataform(int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<Plataform> hibernateRepository = new HibernateRepository<Plataform>(hibernateConnection))
         {
             var plataform = hibernateRepository.FindOne(x => x.Id == pId);
             return plataform;
         }
     }
 }
 public Passage GetPassage(int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<Passage> hibernateRepository = new HibernateRepository<Passage>(hibernateConnection))
         {
             var passage = hibernateRepository.FindOne(x => x.Id == pId);
             return passage;
         }
     }
 }
 public Suggestion GetSuggestion(int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<Suggestion> hibernateRepository = new HibernateRepository<Suggestion>(hibernateConnection))
         {
             var suggestion = hibernateRepository.FindOne(x => x.Id == pId);
             return suggestion;
         }
     }
 }
 public Error GetError(int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<Error> hibernateRepository = new HibernateRepository<Error>(hibernateConnection))
         {
             var error = hibernateRepository.FindOne(x => x.Id == pId);
             return error;
         }
     }
 }
 public LogAccess GetLogAccess(int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<LogAccess> hibernateRepository = new HibernateRepository<LogAccess>(hibernateConnection))
         {
             var logAccess = hibernateRepository.FindOne(x => x.Id == pId);
             return logAccess;
         }
     }
 }
 public BusType GetBusType(int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<BusType> hibernateRepository = new HibernateRepository<BusType>(hibernateConnection))
         {
             var busType = hibernateRepository.FindOne(x => x.Id == pId);
             return busType;
         }
     }
 }
 public LogSearch GetLogSearch(int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<LogSearch> hibernateRepository = new HibernateRepository<LogSearch>(hibernateConnection))
         {
             var logSearch = hibernateRepository.FindOne(x => x.Id == pId);
             return logSearch;
         }
     }
 }
 public nanoit.sptrans.hackatona.core.domain.entity.Application GetApplication(int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<nanoit.sptrans.hackatona.core.domain.entity.Application> hibernateRepository = new HibernateRepository<nanoit.sptrans.hackatona.core.domain.entity.Application>(hibernateConnection))
         {
             var application = hibernateRepository.FindOne(x => x.Id == pId);
             return application;
         }
     }
 }
 public IEnumerable<nanoit.sptrans.hackatona.core.domain.entity.Application> GetLastApplication()
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<nanoit.sptrans.hackatona.core.domain.entity.Application> hibernateRepository = new HibernateRepository<nanoit.sptrans.hackatona.core.domain.entity.Application>(hibernateConnection))
         {
             var application = hibernateRepository.List();
             return application;
         }
     }
 }
 public LogFeature GetLogFeature(int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<LogFeature> hibernateRepository = new HibernateRepository<LogFeature>(hibernateConnection))
         {
             var logFeature = hibernateRepository.FindOne(x => x.Id == pId);
             return logFeature;
         }
     }
 }
 public LineDetail GetLineDetail(int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<LineDetail> hibernateRepository = new HibernateRepository<LineDetail>(hibernateConnection))
         {
             var lineDetail = hibernateRepository.FindOne(x => x.Id == pId);
             return lineDetail;
         }
     }
 }
 public LineRoute GetLineRoute(int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<LineRoute> hibernateRepository = new HibernateRepository<LineRoute>(hibernateConnection))
         {
             var lineRoute = hibernateRepository.FindOne(x => x.Id == pId);
             return lineRoute;
         }
     }
 }
 public IEnumerable<Passage> ListPassage()
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<Passage> hibernateRepository = new HibernateRepository<Passage>(hibernateConnection))
         {
             var passage = hibernateRepository.List();
             return passage;
         }
     }
 }
 public Device GetDevice(string pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<Device> hibernateRepository = new HibernateRepository<Device>(hibernateConnection))
         {
             var device = hibernateRepository.FindOne(x => x.Id == pId);
             return device;
         }
     }
 }
 public ApplicationWarning GetLastApplicationWarning(string pMessage, int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<ApplicationWarning> hibernateRepository = new HibernateRepository<ApplicationWarning>(hibernateConnection))
         {
             var applicationWarning = hibernateRepository.FindMany(x => x.Message == pMessage && x.Application.Id == pId)
                                                         .OrderBy(x => x.DateTimeOfCreation)
                                                         .LastOrDefault();
             return applicationWarning;
         }
     }
 }
 public ApplicationWarning GetApplicationWarning(int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<ApplicationWarning> hibernateRepository = new HibernateRepository<ApplicationWarning>(hibernateConnection))
         {
             var applicationWarning = hibernateRepository.FindMany(x => x.Application.Id == pId &&
                                                                        x.DateTimeOfStart <= DateTimeExtensions.UTCBrazilDateTime &&
                                                                        x.DateTimeOfEnd >= DateTimeExtensions.UTCBrazilDateTime)
                                                         .OrderBy(x => x.DateTimeOfCreation).FirstOrDefault();
             return applicationWarning;
         }
     }
 }
 public bool SaveOrUpdateLineRoute(LineRoute pLineRoute)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<LineRoute> hibernateRepository = new HibernateRepository<LineRoute>(hibernateConnection))
         {
             var insertEntity = hibernateRepository.SaveOrUpdate(pLineRoute);
             if (insertEntity == null)
             {
                 return false;
             }
             else
             {
                 return true;
             }
         }
     }
 }
 public bool SaveOrUpdateBusType(BusType pBusType)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<BusType> hibernateRepository = new HibernateRepository<BusType>(hibernateConnection))
         {
             var insertEntity = hibernateRepository.SaveOrUpdate(pBusType);
             if (insertEntity == null)
             {
                 return false;
             }
             else
             {
                 return true;
             }
         }
     }
 }
 public bool SaveOrUpdateApplicationWarning(ApplicationWarning pApplicationWarning)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<ApplicationWarning> hibernateRepository = new HibernateRepository<ApplicationWarning>(hibernateConnection))
         {
             var insertEntity = hibernateRepository.SaveOrUpdate(pApplicationWarning);
             if (insertEntity == null)
             {
                 return false;
             }
             else
             {
                 return true;
             }
         }
     }
 }
 public bool SaveOrUpdateApplication(nanoit.sptrans.hackatona.core.domain.entity.Application pApplication)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<nanoit.sptrans.hackatona.core.domain.entity.Application> hibernateRepository = new HibernateRepository<nanoit.sptrans.hackatona.core.domain.entity.Application>(hibernateConnection))
         {
             var insertEntity = hibernateRepository.SaveOrUpdate(pApplication);
             if (insertEntity == null)
             {
                 return false;
             }
             else
             {
                 return true;
             }
         }
     }
 }
 public bool SaveOrUpdateLogSearch(LogSearch pLogSearch)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<LogSearch> hibernateRepository = new HibernateRepository<LogSearch>(hibernateConnection))
         {
             var insertEntity = hibernateRepository.SaveOrUpdate(pLogSearch);
             if (insertEntity == null)
             {
                 return false;
             }
             else
             {
                 return true;
             }
         }
     }
 }
 public bool SaveOrUpdatePlataform(Plataform pPlataform)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<Plataform> hibernateRepository = new HibernateRepository<Plataform>(hibernateConnection))
         {
             var insertEntity = hibernateRepository.SaveOrUpdate(pPlataform);
             if (insertEntity == null)
             {
                 return false;
             }
             else
             {
                 return true;
             }
         }
     }
 }
 public bool SaveOrUpdateLogAccess(LogAccess pLogAccess)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<LogAccess> hibernateRepository = new HibernateRepository<LogAccess>(hibernateConnection))
         {
             var insertEntity = hibernateRepository.SaveWithoutTransaction(pLogAccess);
             if (insertEntity == null)
             {
                 return false;
             }
             else
             {
                 return true;
             }
         }
     }
 }
 public bool SaveOrUpdatePassage(Passage pPassage)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<Passage> hibernateRepository = new HibernateRepository<Passage>(hibernateConnection))
         {
             var insertEntity = hibernateRepository.SaveOrUpdate(pPassage);
             if (insertEntity == null)
             {
                 return false;
             }
             else
             {
                 return true;
             }
         }
     }
 }
 public bool SaveOrUpdateSuggestion(Suggestion pSuggestion)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<Suggestion> hibernateRepository = new HibernateRepository<Suggestion>(hibernateConnection))
         {
             var insertEntity = hibernateRepository.SaveOrUpdate(pSuggestion);
             if (insertEntity == null)
             {
                 return false;
             }
             else
             {
                 return true;
             }
         }
     }
 }
 public bool SaveOrUpdateDevice(Device pDevice)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<Device> hibernateRepository = new HibernateRepository<Device>(hibernateConnection))
         {
             var insertEntity = hibernateRepository.SaveOrUpdate(pDevice);
             if (insertEntity == null)
             {
                 return false;
             }
             else
             {
                 return true;
             }
         }
     }
 }