public void CreateApplication(application application) { try { this.ValidateArguments(application); if (this.ExistApplication(application)) { throw new ArgumentException("Aplicação já existe na carteira de investimento."); } _appcontext.applications.Add(application); _appcontext.SaveChanges(); } catch (Exception ex) { throw ex; } }
public void CreateClient(client client) { try { this.ValidateArguments(client); if (this.ExistClient(client)) { throw new ArgumentException("Cliente já existe no cadastro."); } _appcontext.clients.Add(client); _appcontext.SaveChanges(); } catch (Exception ex) { throw ex; } }
public void CreateProductFinancial(productfinancial productfinancial) { try { this.ValidateArguments(productfinancial.name); if (this.ExistProductFinancial(productfinancial)) { throw new ArgumentException("Produto financeiro já existe no cadastro."); } _appcontext.productfinancials.Add(productfinancial); _appcontext.SaveChanges(); } catch (Exception ex) { throw ex; } }