public object insertAsesoriaDetalle(AsesoriaDetalle asesoria)
        {
            object result = null;

            try
            {
                var dyParam = new OracleDynamicParameters();

                dyParam.Add("ad_titulo", OracleDbType.Varchar2, ParameterDirection.Input, asesoria.asesoriaDetalleTitulo);
                dyParam.Add("ad_check", OracleDbType.Int32, ParameterDirection.Input, asesoria.asesoriaDetalleCheck);
                dyParam.Add("a_id", OracleDbType.Int32, ParameterDirection.Input, asesoria.asesoriaId);


                var conn = this.GetConnection();
                if (conn.State == ConnectionState.Closed)
                {
                    conn.Open();
                }

                if (conn.State == ConnectionState.Open)
                {
                    var query = "SP_INSERT_ASESORIA_DETALLE";

                    result = SqlMapper.Query(conn, query, param: dyParam, commandType: CommandType.StoredProcedure);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(result);
        }
Exemplo n.º 2
0
        public ActionResult InsertCapacitacion([FromBody] AsesoriaDetalle asesoria)
        {
            var result = asesoriaDetalleRepository.insertAsesoriaDetalle(asesoria);

            if (result == null)
            {
                return(NotFound());
            }

            return(Ok(result));
        }