public List <TelaPrincipalDTO> RetornaUltimosChamados() { //List<string> UltimosChamados = new List<string>(); List <TelaPrincipalDTO> telaprincDto = new List <TelaPrincipalDTO>(); telaprincDto = cb.RetornaUltimosChamados(); return(telaprincDto); }
public List <TelaPrincipalDTO> RetornaUltimosChamados(string comandoSql) { MySqlCommand comando = new MySqlCommand(comandoSql, objcon); comando.CommandType = CommandType.Text; dr = comando.ExecuteReader(); List <TelaPrincipalDTO> telaPrinDtos = new List <TelaPrincipalDTO>(); //enquanto tiver linhas para serem lidas if (dr.HasRows) { while (dr.Read()) { telaPrinDto = new TelaPrincipalDTO(); telaPrinDto.TelaPrincResumo1 = dr.GetString(0); telaPrinDto.TelaPrincData1 = dr.GetMySqlDateTime(1).ToString(); telaPrinDto.TelaPrincProto1 = dr.GetInt32(2).ToString(); telaPrinDtos.Add(telaPrinDto); } } return(telaPrinDtos); }