public override bool Equals(object obj) { if (this == obj) { return(true); } if (obj == null) { return(false); } if (obj != typeof(Transacao)) { return(false); } Transacao other = (Transacao)obj; if (this.Numero == null) { if (other.Numero != null) { return(false); } } else if (!this.Numero.Equals(other.Numero)) { return(false); } if (this.Titular == null) { if (other.Titular != null) { return(false); } } else if (!this.Titular.Equals(other.Titular)) { return(false); } if (this.Valor == null) { if (other.Valor != null) { return(false); } } else if (!this.Valor.Equals(other.Valor)) { return(false); } return(true); }
public Pagamento CriarPagamento(String numeroCartao, String nomeTitular) { Transacao transacao = new Transacao(); transacao.Numero = numeroCartao; transacao.Titular = nomeTitular; transacao.Valor = this.GetTotal(); //TODO: aqui, fazer a chamada pra um client REST...mas como eu ainda não cheguei //em rest, vou deixar comentado pra ver o que fazer depois //this.Pagamento = this.clienteRest.criarPagamento(transacao); return(this.Pagamento); }