public int Alterar(TipoAluguelViewModel p) { TipoAluguel tipoAluguel = new TipoAluguel() { Id = p.Id, Nome = p.Nome, Valor = p.Valor, }; return(tipoAluguel.Alterar()); }
public int Gravar(TipoAluguelViewModel p) { int result; TipoAluguel tipoAluguel = new TipoAluguel() { Nome = p.Nome, Valor = p.Valor, }; if (p.Id != 0) { tipoAluguel.Id = p.Id; result = tipoAluguel.Alterar(); } else { result = tipoAluguel.Gravar(); } return(result); }