public void Modificar(INaturezaPatente naturezaPatente)
        {
            var comandoSQL = new StringBuilder();
            IDBHelper DBHelper;

            DBHelper = ServerUtils.getDBHelper();

            comandoSQL.Append("UPDATE MP_NATUREZA_PATENTE SET ");
            comandoSQL.Append(String.Concat("DESCRICAO_NATUREZA_PATENTE = '", UtilidadesDePersistencia.FiltraApostrofe(naturezaPatente.DescricaoNaturezaPatente), "', "));
            comandoSQL.Append(String.Concat("SIGLA_NATUREZA = '", UtilidadesDePersistencia.FiltraApostrofe(naturezaPatente.SiglaNatureza), "', "));
            comandoSQL.Append(String.Concat("TEMPO_INICIO_ANOS = ", naturezaPatente.TempoInicioAnos, ", "));
            comandoSQL.Append(String.Concat("QUANTIDADE_PAGTO = ", naturezaPatente.QuantidadePagamento, ", "));
            comandoSQL.Append(String.Concat("TEMPO_ENTRE_PAGTO = ", naturezaPatente.TempoEntrePagamento, ", "));
            comandoSQL.Append(String.Concat("SEQUENCIA_INICIO_PAGTO = ", naturezaPatente.SequenciaInicioPagamento, ", "));
            comandoSQL.Append(naturezaPatente.TemPagamentoIntermediario ? String.Concat("TEM_PAGTO_INTERMEDIARIO = '", 1, "', ") :
                                                                          String.Concat("TEM_PAGTO_INTERMEDIARIO = '", 0, "', "));
            comandoSQL.Append(String.Concat("INICIO_INTERMED_SEQUENCIA = ", naturezaPatente.InicioIntermediarioSequencia, ", "));
            comandoSQL.Append(String.Concat("QUANTIDADE_PAGTO_INTERMED = ", naturezaPatente.QuantidadePagamentoIntermediario, ", "));
            comandoSQL.Append(String.Concat("TEMPO_ENTRE_PAGTO_INTERMED = ", naturezaPatente.TempoEntrePagamentoIntermediario, ", "));
            comandoSQL.Append(String.Concat("DESCRICAO_PAGTO = '", UtilidadesDePersistencia.FiltraApostrofe(naturezaPatente.DescricaoPagamento), "', "));
            comandoSQL.Append(String.Concat("DESCRICAO_PAGTO_INTERMED = '", UtilidadesDePersistencia.FiltraApostrofe(naturezaPatente.DescricaoPagamentoIntermediario), "', "));
            comandoSQL.Append(naturezaPatente.TemPedidoDeExame ? String.Concat("TEM_PED_EXAME = '", 1, "' ") :
                                                                 String.Concat("TEM_PED_EXAME = '", 0, "' "));
            comandoSQL.Append(String.Concat("WHERE IDNATUREZA_PATENTE = ", naturezaPatente.IdNaturezaPatente.Value.ToString()));

            DBHelper.ExecuteNonQuery(comandoSQL.ToString());
        }
        public void Inserir(INaturezaPatente naturezaPatente)
        {
            var comandoSQL = new StringBuilder();
            IDBHelper DBHelper;

            DBHelper = ServerUtils.getDBHelper();

            naturezaPatente.IdNaturezaPatente = GeradorDeID.getInstancia().getProximoID();

            comandoSQL.Append("INSERT INTO MP_NATUREZA_PATENTE (");
            comandoSQL.Append("IDNATUREZA_PATENTE, DESCRICAO_NATUREZA_PATENTE, SIGLA_NATUREZA, TEMPO_INICIO_ANOS, QUANTIDADE_PAGTO, ");
            comandoSQL.Append("TEMPO_ENTRE_PAGTO, SEQUENCIA_INICIO_PAGTO, TEM_PAGTO_INTERMEDIARIO, INICIO_INTERMED_SEQUENCIA, QUANTIDADE_PAGTO_INTERMED, ");
            comandoSQL.Append("TEMPO_ENTRE_PAGTO_INTERMED, DESCRICAO_PAGTO, DESCRICAO_PAGTO_INTERMED, TEM_PED_EXAME) ");
            comandoSQL.Append("VALUES (");
            comandoSQL.Append(String.Concat(naturezaPatente.IdNaturezaPatente.Value.ToString(), ", "));
            comandoSQL.Append(String.Concat("'", UtilidadesDePersistencia.FiltraApostrofe(naturezaPatente.DescricaoNaturezaPatente), "', "));
            comandoSQL.Append(String.Concat("'", UtilidadesDePersistencia.FiltraApostrofe(naturezaPatente.SiglaNatureza), "', "));
            comandoSQL.Append(String.Concat(naturezaPatente.TempoInicioAnos, ", "));
            comandoSQL.Append(String.Concat(naturezaPatente.QuantidadePagamento, ", "));
            comandoSQL.Append(String.Concat(naturezaPatente.TempoEntrePagamento, ", "));
            comandoSQL.Append(String.Concat(naturezaPatente.SequenciaInicioPagamento, ", "));
            comandoSQL.Append(naturezaPatente.TemPagamentoIntermediario ? String.Concat("'", 1, "', ") : String.Concat("'", 0, "', "));
            comandoSQL.Append(String.Concat(naturezaPatente.InicioIntermediarioSequencia, ", "));
            comandoSQL.Append(String.Concat(naturezaPatente.QuantidadePagamentoIntermediario, ", "));
            comandoSQL.Append(String.Concat(naturezaPatente.TempoEntrePagamentoIntermediario, ", "));
            comandoSQL.Append(String.Concat("'", UtilidadesDePersistencia.FiltraApostrofe(naturezaPatente.DescricaoPagamento), "', "));
            comandoSQL.Append(String.Concat("'", UtilidadesDePersistencia.FiltraApostrofe(naturezaPatente.DescricaoPagamentoIntermediario), "', "));
            comandoSQL.Append(naturezaPatente.TemPedidoDeExame ? String.Concat("'", 1, "') ") : String.Concat("'", 0, "') "));

            DBHelper.ExecuteNonQuery(comandoSQL.ToString());
        }
        public void Modificar(INaturezaPatente naturezaPatente)
        {
            ServerUtils.setCredencial(_Credencial);

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

            try
            {
                ServerUtils.BeginTransaction();
                mapeador.Modificar(naturezaPatente);
                ServerUtils.CommitTransaction();
            }
            catch
            {
                ServerUtils.RollbackTransaction();
                throw;
            }
            finally
            {
                ServerUtils.libereRecursos();
            }
        }
Ejemplo n.º 4
0
        private IList<IAnuidadePatente> ObtenhaAnuidadesDaPatente(DataRow linha, IServicoDePatente servico, INaturezaPatente natureza)
        {
            if (Information.IsDBNull(linha["data_depósito"]) || string.IsNullOrEmpty(UtilidadesDePersistencia.GetValor(linha, "data_depósito")))
                return null;

            var dataDoDeposito = ObtenhaData(UtilidadesDePersistencia.GetValor(linha, "data_depósito"));

            IList<IAnuidadePatente> anuidades;

            if (natureza.SiglaNatureza.Equals("DI") ||
                natureza.SiglaNatureza.Equals("30") ||
                natureza.SiglaNatureza.Equals("31") ||
                natureza.SiglaNatureza.Equals("32") ||
                natureza.SiglaNatureza.Equals("MI"))
            {
                anuidades = servico.CalculeAnuidadesPatentesDeNaturezaDI(dataDoDeposito);
                return ObtenhaAnuidadesPatenteDesenhoIndustrial(linha, anuidades);
            }
            else
            {
                anuidades = servico.CalculeAnuidadesPatentesDeNaturezaPIeMU(dataDoDeposito);
                return ObtenhaAnuidadesPatente(linha, anuidades);
            }
        }
 private void VerificaSeNaturezaEhDeDesenhoIndustrial(INaturezaPatente natureza)
 {
     ExibaTabDeImagemDeDesenhoIndustrial(natureza.EhNaturezaDeDesenhoIndustrial());
 }
 public void CarregueObjetoReal()
 {
     _objetoReal = RepositorioDeNaturezaDePatente.obtenhaInstancia().obtenhaDespachoDeMarcasPeloId(_id.Value);
 }