public void Inserir(IInventor inventor)
        {
            var sql = new StringBuilder();
            IDBHelper DBHelper;

            DBHelper = ServerUtils.getDBHelper();

            sql.Append("INSERT INTO MP_INVENTOR (");
            sql.Append("IDPESSOA, TIPOPESSOA, DTCADASTRO, INFOADICIONAL)");
            sql.Append("VALUES (");
            sql.Append(String.Concat(inventor.Pessoa.ID.Value, ", "));
            sql.Append(String.Concat(inventor.Pessoa.Tipo.ID, ", "));
            sql.Append(String.Concat(inventor.DataDoCadastro.Value.ToString("yyyyMMdd"), ", "));

            if (string.IsNullOrEmpty(inventor.InformacoesAdicionais))
                sql.Append("NULL)");
            else
                sql.Append(String.Concat("'", UtilidadesDePersistencia.FiltraApostrofe(inventor.InformacoesAdicionais), "')"));

            DBHelper.ExecuteNonQuery(sql.ToString());
        }
        public void Atualizar(IInventor inventor)
        {
            var sql = new StringBuilder();
            IDBHelper DBHelper;

            DBHelper = ServerUtils.getDBHelper();

            sql.Append("UPDATE MP_INVENTOR SET ");
            sql.Append("INFOADICIONAL = ");

            if (string.IsNullOrEmpty(inventor.InformacoesAdicionais))
            {
                sql.Append("NULL)");
            }
            else
            {
                sql.Append(String.Concat("'", UtilidadesDePersistencia.FiltraApostrofe(inventor.InformacoesAdicionais), "'"));
            }

            DBHelper.ExecuteNonQuery(sql.ToString());
        }
        public void Inserir(IInventor inventor)
        {
            ServerUtils.setCredencial(_Credencial);

            var mapeador = FabricaGenerica.GetInstancia().CrieObjeto<IMapeadorDeInventor>();

            try
            {
                ServerUtils.BeginTransaction();
                mapeador.Inserir(inventor);
                ServerUtils.CommitTransaction();
            }
            catch
            {
                ServerUtils.RollbackTransaction();
                throw;
            }
            finally
            {
                ServerUtils.libereRecursos();
            }
        }
Exemplo n.º 4
0
 public bool CanInvent(IInventor inventor)
 {
     return(InventedPreviousTechs.isAllTrue(inventor));
 }
Exemplo n.º 5
0
 private void MostreInventor(IInventor inventor)
 {
     ctrlPessoa1.PessoaSelecionada = inventor.Pessoa;
     txtDataDoCadastro.SelectedDate = inventor.DataDoCadastro;
     txtInformacoesAdicionais.Text = inventor.InformacoesAdicionais;
     ctrlPessoa1.BotaoDetalharEhVisivel = true;
 }
Exemplo n.º 6
0
        private void InserirInventorPatente(IInventor inventor, long idPatente)
        {
            var comandoSQL = new StringBuilder();
            IDBHelper DBHelper = ServerUtils.getDBHelper();

            comandoSQL.Append("INSERT INTO MP_PATENTEINVENTOR(IDINVENTOR, IDPATENTE) VALUES(");
            comandoSQL.Append(inventor.Pessoa.ID + ", ");
            comandoSQL.Append(idPatente + ")");
            DBHelper.ExecuteNonQuery(comandoSQL.ToString());
        }