public EscolaDTO GetByID(EscolaDTO _escola) { EscolaDAL cmd = new EscolaDAL(); var result = cmd.GetDataInDataBase(_escola); if (result.Count > 0) { if (result[0].idEndereco != 0) { EnderecoDAL cmdEndereco = new EnderecoDAL(); result[0].endereco = cmdEndereco.GetEndereco(result[0].idEndereco); } return(result.SingleOrDefault()); } else { throw new Exception("Ocorreu um erro!"); } }
public List <EscolaDTO> GetDataWithParam(EscolaDTO _projeto) { EscolaDAL cmd = new EscolaDAL(); return(cmd.GetDataInDataBase(_projeto)); }
public List <EscolaDTO> GetAllData() { EscolaDAL cmd = new EscolaDAL(); return(cmd.GetDataInDataBase(new EscolaDTO())); }