2
Follow the error:
"Logincliente(string, string)":not all source paths return a value
class Conta
{
#region atributos
public String nomeCliente { get; set; }
public String numAgencia { get; set; }
public String numConta { get; set; }
public Boolean contaExiste { get; set; }
public Decimal saldoCC { get; set; }
public Decimal saldoPoupanca { get; set; }
#endregion
#region metodos
public Conta()
{
Console.WriteLine("Conta não existe");
}
public Conta(String znome, String zAgencia, String zConta, Decimal zsaldoCC, Decimal zsaldoPP)
{
nomeCliente = znome;
numAgencia = zAgencia;
numConta = zConta;
saldoPoupanca = 0.0m;
zsaldoCC = 0.0M;
contaExiste = true;
}
public Conta LoginCliente( String Agencia, String Conta)
{
DAO.SQL conexao = new DAO.SQL();
conexao.AbrirConexao();
Conta conta = conexao.ConsultarCliente(Agencia, Conta);
conexao.FecharConexao();
if(conta != null)
{
return conta;
}
People the mistake I’m getting is coming from Logincliente
– Tony Michael
What do you want to return if the account is void? The
ConsultarCliente()
receives the account as argument. And returns account as well. Can it be another account? Can it be null? This code has several weird things.– Maniero