コード例 #1
0
        public Result<Anotacion> Create( Anotacion anotacion )
        {
            try
            {
                using (var conn = DB.GetOracleConnection())
                using (var cmd = DB.GetFuncionCommand( conn, "WEB_LEGEM.CREATE_A" ))
                {
                    var result = DB.AddObjectResult( cmd, UdtTypeName );
                    DB.AddObjectParameter( cmd, "NEW_A", UdtTypeName, anotacion );

                    cmd.ExecuteNonQuery();
                    return Result.Ok( (Anotacion) result.Value );
                } // end using cmd
            } // end try
            catch (Exception ex)
            {
                return Result.Fail<Anotacion>( "No se pudo crear la anotacion" );
            } // end catch
        }
コード例 #2
0
        private Anotacion GetAnotacionFromSentence(string sentence)
        {
            // TODO -implementar methodo GetAnotacionFromSentece
            var anotacion = new Anotacion()
            {
                TipoAnotacion = GetTipoAnotacionFromSentence(sentence),
                DocumentoAnotado = new Documento()
                {
                    TipoDocumento = GetTipoDocumentoFromSentence(sentence),
                    Numero = GetNumeroDocumentoFromSentence( sentence )
                }
            };

            var fecha = GetFechaDocumentoFromSentece(sentence);
            if (fecha.HasValue)
                anotacion.DocumentoAnotado.FechaPublicacion = fecha.Value;

            return anotacion;
        }