private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t935_idcategoriaprofesional: paramName = "@t935_idcategoriaprofesional"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t941_idcolectivo: paramName = "@t941_idcolectivo"; paramType = SqlDbType.Int; paramSize = 4; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.MostrarInactivos: paramName = "@bMostrarInactivos"; paramType = SqlDbType.Bit; paramSize = 1; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t001_idficepi: paramName = "@t001_idficepi"; paramType = SqlDbType.SmallInt; paramSize = 2; break; case enumDBFields.parentesco: paramName = "@parentesco"; paramType = SqlDbType.SmallInt; paramSize = 2; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t332_idtarea: paramName = "@t332_idtarea"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t410_idaccion: paramName = "@t410_idaccion"; paramType = SqlDbType.Int; paramSize = 4; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.sIDRED: paramName = "@sIDRED"; paramType = SqlDbType.VarChar; paramSize = 15; break; case enumDBFields.t314_idusuario: paramName = "@t314_idusuario"; paramType = SqlDbType.Int; paramSize = 4; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.ta209_idconceptotareapendiente: paramName = "@ta209_idconceptotareapendiente"; paramType = SqlDbType.TinyInt; paramSize = 1; break; case enumDBFields.ta209_denominacion: paramName = "@ta209_denominacion"; paramType = SqlDbType.VarChar; paramSize = 50; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.ta205_idtipoaccionpreventa: paramName = "@ta205_idtipoaccionpreventa"; paramType = SqlDbType.SmallInt; paramSize = 2; break; case enumDBFields.ta205_denominacion: paramName = "@ta205_denominacion"; paramType = SqlDbType.VarChar; paramSize = 50; break; case enumDBFields.ta205_origen_on: paramName = "@ta205_origen_on"; paramType = SqlDbType.Bit; paramSize = 1; break; case enumDBFields.ta205_origen_partida: paramName = "@ta205_origen_partida"; paramType = SqlDbType.Bit; paramSize = 1; break; case enumDBFields.ta205_origen_super: paramName = "@ta205_origen_super"; paramType = SqlDbType.Bit; paramSize = 1; break; case enumDBFields.ta205_estadoactiva: paramName = "@ta205_estadoactiva"; paramType = SqlDbType.Bit; paramSize = 1; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t314_idusuario: paramName = "@t314_idusuario"; paramType = SqlDbType.VarChar; paramSize = 8000; break; case enumDBFields.t302_idcliente: paramName = "@t302_idcliente"; paramType = SqlDbType.VarChar; paramSize = 8000; break; case enumDBFields.t305_idproyectosubnodo: paramName = "@t305_idproyectosubnodo"; paramType = SqlDbType.VarChar; paramSize = 8000; break; case enumDBFields.facturable: paramName = "@facturable"; paramType = SqlDbType.Bit; paramSize = 1; break; case enumDBFields.t337_fecha_desde: paramName = "@t337_fecha_desde"; paramType = SqlDbType.SmallDateTime; paramSize = 8; break; case enumDBFields.t337_fecha_hasta: paramName = "@t337_fecha_hasta"; paramType = SqlDbType.SmallDateTime; paramSize = 8; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t423_idmotivo: paramName = "@t423_idmotivo"; paramType = SqlDbType.TinyInt; paramSize = 1; break; case enumDBFields.t423_denominacion: paramName = "@t423_denominacion"; paramType = SqlDbType.VarChar; paramSize = 50; break; case enumDBFields.t423_estado: paramName = "@t423_estado"; paramType = SqlDbType.Bit; paramSize = 1; break; case enumDBFields.t423_cuenta: paramName = "@t423_cuenta"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.nOrden: paramName = "@nOrden"; paramType = SqlDbType.TinyInt; paramSize = 1; break; case enumDBFields.nAscDesc: paramName = "@nAscDesc"; paramType = SqlDbType.TinyInt; paramSize = 1; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.ta200_idareapreventa: paramName = "@ta200_idareapreventa"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.ta200_denominacion: paramName = "@ta200_denominacion"; paramType = SqlDbType.VarChar; paramSize = 50; break; case enumDBFields.ta200_estadoactiva: paramName = "@ta200_estadoactiva"; paramType = SqlDbType.Bit; paramSize = 1; break; case enumDBFields.t001_idficepi_responsable: paramName = "@t001_idficepi_responsable"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.ta199_idunidadpreventa: paramName = "@ta199_idunidadpreventa"; paramType = SqlDbType.SmallInt; paramSize = 2; break; case enumDBFields.t331_idpt: paramName = "@t331_idpt"; paramType = SqlDbType.Int; paramSize = 4; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.ta212_idorganizacioncomercial: paramName = "@ta212_idorganizacioncomercial"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t001_idficepi_comercial: paramName = "@t001_idficepi_comercial"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t331_idpt: paramName = "@t331_idpt"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.ta212_activa: paramName = "@ta212_activa"; paramType = SqlDbType.Bit; paramSize = 1; break; case enumDBFields.bMostrarProfBaja: paramName = "@bMostrarProfBaja"; paramType = SqlDbType.Bit; paramSize = 1; break; case enumDBFields.ta213_nocambioautomatico: paramName = "@ta213_nocambioautomatico"; paramType = SqlDbType.Bit; paramSize = 1; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t314_idusuario: paramName = "@t314_idusuario"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t332_idtarea: paramName = "@t332_idtarea"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t336_ete: paramName = "@t336_ete"; paramType = SqlDbType.Float; paramSize = 8; break; case enumDBFields.t336_ffe: paramName = "@t336_ffe"; paramType = SqlDbType.DateTime; paramSize = 4; break; case enumDBFields.t336_comentario: paramName = "@t336_comentario"; paramType = SqlDbType.Text; paramSize = 2147483647; break; case enumDBFields.t336_completado: paramName = "@t336_completado"; paramType = SqlDbType.Bit; paramSize = 1; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t937_comentario_respdestino: paramName = "@t937_comentario_respdestino"; paramType = SqlDbType.VarChar; paramSize = 750; break; case enumDBFields.estado: paramName = "@estado"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.idpeticion: paramName = "@t937_idpetcambioresp"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.idficepi_fin: paramName = "@t001_idficepi_fin"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t001_idficepi: paramName = "@t001_idficepi"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.listapeticiones: paramName = "@listapeticiones"; paramType = SqlDbType.VarChar; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.idficepiVisualizador: paramName = "@t001_idficepi_visualizador"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.idficepiVisualizado: paramName = "@t001_idficepi_visualizado"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.tabla: paramName = "@tabla"; paramType = SqlDbType.Char; paramSize = 1; break; case enumDBFields.accion: paramName = "@t949_accion"; paramType = SqlDbType.Char; paramSize = 1; break; case enumDBFields.datatable: paramName = "@TMPVISUALIZADOS"; paramType = SqlDbType.Structured; paramSize = 4; break; case enumDBFields.visualizador: paramName = "@visualizador"; paramType = SqlDbType.Int; paramSize = 4; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t067_dia: paramName = "@t067_dia"; paramType = SqlDbType.DateTime; paramSize = 8; break; case enumDBFields.nIdCal: paramName = "@nIdCal"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.dUMC: paramName = "@dUMC"; paramType = SqlDbType.DateTime; paramSize = 8; break; case enumDBFields.t066_idcal: paramName = "@t066_idcal"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.diaDesde: paramName = "@diadesde"; paramType = SqlDbType.Date; paramSize = 8; break; case enumDBFields.diaHasta: paramName = "@diahasta"; paramType = SqlDbType.Date; paramSize = 8; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t409_idasunto: paramName = "@t409_idasunto"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t416_estado: paramName = "@t416_codestado"; paramType = SqlDbType.TinyInt; paramSize = 1; break; //case enumDBFields.Estado: // paramName = "@Estado"; // paramType = SqlDbType.VarChar; // paramSize = 10; // break; //case enumDBFields.t416_fecha: // paramName = "@t416_fecha"; // paramType = SqlDbType.DateTime; // paramSize = 8; // break; case enumDBFields.t314_idusuario: paramName = "@t314_idusuario"; paramType = SqlDbType.Int; paramSize = 4; break; //case enumDBFields.nomRecurso: // paramName = "@nomRecurso"; // paramType = SqlDbType.VarChar; // paramSize = 73; // break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t331_idpt: paramName = "@t331_idpt"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t305_idproyectosubnodo: paramName = "@t305_idproyectosubnodo"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t301_idproyecto: paramName = "@t301_idproyecto"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t331_despt: paramName = "@t331_despt"; paramType = SqlDbType.VarChar; paramSize = 50; break; case enumDBFields.t301_denominacion: paramName = "@t301_denominacion"; paramType = SqlDbType.VarChar; paramSize = 70; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
/// <summary> /// Inserta un JornadaCalendario /// </summary> /* internal int Insert(Models.JornadaCalendario oJornadaCalendario) * { * try * { * SqlParameter[] dbparams = new SqlParameter[8] { * Param(enumDBFields.dia, oJornadaCalendario.dia), * Param(enumDBFields.estilo_festivo, oJornadaCalendario.estilo_festivo), * Param(enumDBFields.esfuerzo, oJornadaCalendario.esfuerzo), * Param(enumDBFields.horas_estandar, oJornadaCalendario.horas_estandar), * Param(enumDBFields.dia_entero, oJornadaCalendario.dia_entero), * Param(enumDBFields.horas_planificadas, oJornadaCalendario.horas_planificadas), * Param(enumDBFields.dia_festivo, oJornadaCalendario.dia_festivo), * Param(enumDBFields.dia_vacaciones, oJornadaCalendario.dia_vacaciones) * }; * * return (int)cDblib.Execute("SUPER.IAP30_JornadaCalendario_INS", dbparams); * } * catch (Exception ex) * { * throw ex; * } * } * * /// <summary> * /// Obtiene un JornadaCalendario a partir del id * /// </summary> * internal Models.JornadaCalendario Select() * { * Models.JornadaCalendario oJornadaCalendario = null; * IDataReader dr = null; * * try * { * * * dr = cDblib.DataReader("SUPER.IAP30_JornadaCalendario_SEL", dbparams); * if (dr.Read()) * { * oJornadaCalendario = new Models.JornadaCalendario(); * if(!Convert.IsDBNull(dr["dia"])) * oJornadaCalendario.dia=Convert.ToInt32(dr["dia"]); * oJornadaCalendario.estilo_festivo=Convert.ToInt32(dr["estilo_festivo"]); * oJornadaCalendario.esfuerzo=Convert.ToDouble(dr["esfuerzo"]); * oJornadaCalendario.horas_estandar=Convert.ToSingle(dr["horas_estandar"]); * oJornadaCalendario.dia_entero=Convert.ToDateTime(dr["dia_entero"]); * oJornadaCalendario.horas_planificadas=Convert.ToDouble(dr["horas_planificadas"]); * oJornadaCalendario.dia_festivo=Convert.ToInt32(dr["dia_festivo"]); * oJornadaCalendario.dia_vacaciones=Convert.ToInt32(dr["dia_vacaciones"]); * * } * return oJornadaCalendario; * * } * catch (Exception ex) * { * throw ex; * } * finally * { * if (dr != null) * { * if (!dr.IsClosed) dr.Close(); * dr.Dispose(); * } * } * } * * /// <summary> * /// Actualiza un JornadaCalendario a partir del id * /// </summary> * internal int Update(Models.JornadaCalendario oJornadaCalendario) * { * try * { * SqlParameter[] dbparams = new SqlParameter[8] { * Param(enumDBFields.dia, oJornadaCalendario.dia), * Param(enumDBFields.estilo_festivo, oJornadaCalendario.estilo_festivo), * Param(enumDBFields.esfuerzo, oJornadaCalendario.esfuerzo), * Param(enumDBFields.horas_estandar, oJornadaCalendario.horas_estandar), * Param(enumDBFields.dia_entero, oJornadaCalendario.dia_entero), * Param(enumDBFields.horas_planificadas, oJornadaCalendario.horas_planificadas), * Param(enumDBFields.dia_festivo, oJornadaCalendario.dia_festivo), * Param(enumDBFields.dia_vacaciones, oJornadaCalendario.dia_vacaciones) * }; * * return (int)cDblib.Execute("SUPER.IAP30_JornadaCalendario_UPD", dbparams); * } * catch (Exception ex) * { * throw ex; * } * } * * /// <summary> * /// Elimina un JornadaCalendario a partir del id * /// </summary> * internal int Delete() * { * try * { * * * return (int)cDblib.Execute("SUPER.IAP30_JornadaCalendario_DEL", dbparams); * } * catch (Exception ex) * { * throw ex; * } * } */ #endregion #region funciones privadas private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.codUsu: paramName = "@t314_idusuario"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.idficepi: paramName = "@idFicepi"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.codCal: paramName = "@t066_idcal"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.mes: paramName = "@nMes"; paramType = SqlDbType.TinyInt; paramSize = 4; break; case enumDBFields.anno: paramName = "@nAnno"; paramType = SqlDbType.SmallInt; paramSize = 4; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.idPT: paramName = "@t331_idpt"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t305_idproyectosubnodo: paramName = "@t305_idproyectosubnodo"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.sNomPT: paramName = "@sNomPT"; paramType = SqlDbType.VarChar; paramSize = 50; break; case enumDBFields.t314_idusuario: paramName = "@t314_idusuario"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.tipoBusq: paramName = "@sTipoBusq"; paramType = SqlDbType.Char; paramSize = 1; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
//#endregion #region funciones privadas private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t419_anno: paramName = "@t419_anno"; paramType = SqlDbType.SmallInt; paramSize = 2; break; case enumDBFields.t419_fdesde: paramName = "@t419_fdesde"; paramType = SqlDbType.DateTime; paramSize = 8; break; case enumDBFields.t419_fhasta: paramName = "@t419_fhasta"; paramType = SqlDbType.DateTime; paramSize = 8; break; case enumDBFields.t001_idficepi: paramName = "@t001_idficepi"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t419_fmodif: paramName = "@t419_fmodif"; paramType = SqlDbType.DateTime; paramSize = 8; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t302_denominacion: paramName = "@t302_denominacion"; paramType = SqlDbType.VarChar; paramSize = 100; break; case enumDBFields.sTipoBusqueda: paramName = "@sTipoBusqueda"; paramType = SqlDbType.Char; paramSize = 1; break; case enumDBFields.bSoloActivos: paramName = "@bSoloActivos"; paramType = SqlDbType.Bit; paramSize = 1; break; case enumDBFields.bInternos: paramName = "@bInternos"; paramType = SqlDbType.Bit; paramSize = 1; break; case enumDBFields.t314_idusuario: paramName = "@t314_idusuario"; paramType = SqlDbType.Int; paramSize = 4; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
//internal List<Models.FormacionDemandada> catFormacionDemandadaExcel(Int32 idficepi, Int32 desde, Int32 hasta, Nullable<Int16> t941_idcolectivo) //{ // Models.FormacionDemandada oFormacionDemandada = new Models.FormacionDemandada(); // // List<Models.FormacionDemandada> lista = new List<Models.FormacionDemandada>(); // //ParĂ¡metros de salida // SqlParameter nevaluaciones = null; // Models.FormacionDemandadaSelect1 oFDS1 = null; // IDataReader dr = null; // try // { // SqlParameter[] dbparams = new SqlParameter[5] { // Param(ParameterDirection.Input, enumDBFields.idficepi, desde.ToString()), // Param(ParameterDirection.Input, enumDBFields.desde, desde.ToString()), // Param(ParameterDirection.Input, enumDBFields.hasta, hasta.ToString()), // Param(ParameterDirection.Input, enumDBFields.idcolectivo, (t941_idcolectivo==null)?null:t941_idcolectivo.ToString()), // nevaluaciones = Param(ParameterDirection.Output, enumDBFields.nevaluaciones, "0") // }; // dr = cDblib.DataReader("PRO_FORMACIONDEMANDADA_GET", dbparams); // while (dr.Read()) // { // oFDS1 = new Models.FormacionDemandadaSelect1(); // if (!Convert.IsDBNull(dr["evaluador"])) // oFDS1.Evaluador = dr["evaluador"].ToString(); // if (!Convert.IsDBNull(dr["evaluado"])) // oFDS1.Evaluado = dr["evaluado"].ToString(); // if (!Convert.IsDBNull(dr["t930_idvaloracion"])) // oFDS1.T930_idvaloracion = int.Parse(dr["t930_idvaloracion"].ToString()); // if (!Convert.IsDBNull(dr["t930_formacion"])) // oFDS1.Formacion = dr["t930_formacion"].ToString(); // if (!Convert.IsDBNull(dr["t934_idmodeloformulario"])) // oFDS1.idformulario = int.Parse(dr["t934_idmodeloformulario"].ToString()); // oFormacionDemandada.FormacionDemandadaS1.Add(oFDS1); // } // return oFormacionDemandada; // } // catch (Exception ex) // { // throw ex; // } // finally // { // if (dr != null) // { // if (!dr.IsClosed) dr.Close(); // dr.Dispose(); // //Hasta no hacer el dispose, no obtienen valor los parĂ¡metros de salida // oFormacionDemandada.Nevaluciones = Int32.Parse(nevaluaciones.Value.ToString()); // } // } //} #region funciones publicas #endregion #region funciones privadas private SqlParameter Param(ParameterDirection paramDirection, enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; switch (dbField) { case enumDBFields.desde: paramName = "@desde"; paramType = SqlDbType.Int; paramSize = 3; break; case enumDBFields.hasta: paramName = "@hasta"; paramType = SqlDbType.Int; paramSize = 3; break; case enumDBFields.idcolectivo: paramName = "@idcolectivo"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.nevaluaciones: paramName = "@nevaluaciones"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.idficepi: paramName = "@t001_idficepi"; paramType = SqlDbType.Int; paramSize = 4; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.Profesionales: paramName = "@Profesionales"; paramType = SqlDbType.VarChar; paramSize = 8000; break; case enumDBFields.nDesde: paramName = "@nDesde"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.nHasta: paramName = "@nHasta"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.tipo: paramName = "@tipo"; paramType = SqlDbType.Char; paramSize = 1; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
///// <summary> ///// Inserta un Historial ///// </summary> //internal int Insert(Models.Historial oHistorial) //{ // try // { // SqlParameter[] dbparams = new SqlParameter[4] { // Param(enumDBFields.t431_denominacion, oHistorial.t431_denominacion), // Param(enumDBFields.t659_fecha, oHistorial.t659_fecha), // Param(enumDBFields.Profesional, oHistorial.Profesional), // Param(enumDBFields.t659_motivo, oHistorial.t659_motivo) // }; // return (int)cDblib.Execute("_Historial_INS", dbparams); // } // catch (Exception ex) // { // throw ex; // } //} ///// <summary> ///// Obtiene un Historial a partir del id ///// </summary> //internal Models.Historial Select() //{ // Models.Historial oHistorial = null; // IDataReader dr = null; // try // { // dr = cDblib.DataReader("_Historial_SEL", dbparams); // if (dr.Read()) // { // oHistorial = new Models.Historial(); // if(!Convert.IsDBNull(dr["t431_denominacion"])) // oHistorial.t431_denominacion=Convert.ToString(dr["t431_denominacion"]); // oHistorial.t659_fecha=Convert.ToDateTime(dr["t659_fecha"]); // if(!Convert.IsDBNull(dr["Profesional"])) // oHistorial.Profesional=Convert.ToString(dr["Profesional"]); // oHistorial.t659_motivo=Convert.ToString(dr["t659_motivo"]); // } // return oHistorial; // } // catch (Exception ex) // { // throw ex; // } // finally // { // if (dr != null) // { // if (!dr.IsClosed) dr.Close(); // dr.Dispose(); // } // } //} ///// <summary> ///// Actualiza un Historial a partir del id ///// </summary> //internal int Update(Models.Historial oHistorial) //{ // try // { // SqlParameter[] dbparams = new SqlParameter[4] { // Param(enumDBFields.t431_denominacion, oHistorial.t431_denominacion), // Param(enumDBFields.t659_fecha, oHistorial.t659_fecha), // Param(enumDBFields.Profesional, oHistorial.Profesional), // Param(enumDBFields.t659_motivo, oHistorial.t659_motivo) // }; // return (int)cDblib.Execute("_Historial_UPD", dbparams); // } // catch (Exception ex) // { // throw ex; // } //} ///// <summary> ///// Elimina un Historial a partir del id ///// </summary> //internal int Delete() //{ // try // { // return (int)cDblib.Execute("_Historial_DEL", dbparams); // } // catch (Exception ex) // { // throw ex; // } //} /// <summary> /// Obtiene todos los Historial /// </summary> //internal List<Models.Historial> Catalogo(Models.Historial oHistorialFilter) //{ // Models.Historial oHistorial = null; // List<Models.Historial> lst = new List<Models.Historial>(); // IDataReader dr = null; // try // { // SqlParameter[] dbparams = new SqlParameter[4] { // Param(enumDBFields.t431_denominacion, oTEMP_HistorialFilter.t431_denominacion), // Param(enumDBFields.t659_fecha, oTEMP_HistorialFilter.t659_fecha), // Param(enumDBFields.Profesional, oTEMP_HistorialFilter.Profesional), // Param(enumDBFields.t659_motivo, oTEMP_HistorialFilter.t659_motivo) // }; // dr = cDblib.DataReader("_Historial_CAT", dbparams); // while (dr.Read()) // { // oHistorial = new Models.Historial(); // if (!Convert.IsDBNull(dr["t431_denominacion"])) // oHistorial.t431_denominacion = Convert.ToString(dr["t431_denominacion"]); // oHistorial.t659_fecha = Convert.ToDateTime(dr["t659_fecha"]); // if (!Convert.IsDBNull(dr["Profesional"])) // oHistorial.Profesional = Convert.ToString(dr["Profesional"]); // oHistorial.t659_motivo = Convert.ToString(dr["t659_motivo"]); // lst.Add(oHistorial); // } // return lst; // } // catch (Exception ex) // { // throw ex; // } // finally // { // if (dr != null) // { // if (!dr.IsClosed) dr.Close(); // dr.Dispose(); // } // } //} #endregion #region funciones privadas private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t431_denominacion: paramName = "@t431_denominacion"; paramType = SqlDbType.VarChar; paramSize = 20; break; case enumDBFields.t659_fecha: paramName = "@t659_fecha"; paramType = SqlDbType.DateTime; paramSize = 8; break; case enumDBFields.Profesional: paramName = "@Profesional"; paramType = SqlDbType.VarChar; paramSize = 150; break; case enumDBFields.t659_motivo: paramName = "@t659_motivo"; paramType = SqlDbType.VarChar; paramSize = 500; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.ta212_idorganizacioncomercial: paramName = "@ta212_idorganizacioncomercial"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.ta212_denominacion: paramName = "@ta212_denominacion"; paramType = SqlDbType.VarChar; paramSize = 50; break; case enumDBFields.ta212_codigoexterno: paramName = "@ta212_codigoexterno"; paramType = SqlDbType.VarChar; paramSize = 15; break; case enumDBFields.ta212_activa: paramName = "@ta212_activa"; paramType = SqlDbType.Bit; paramSize = 1; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t314_idusuario: paramName = "@t314_idusuario"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t615_fechoraida: paramName = "@fec_desde"; paramType = SqlDbType.DateTime; paramSize = 8; break; case enumDBFields.t615_fechoravuelta: paramName = "@fec_hasta"; paramType = SqlDbType.DateTime; paramSize = 8; break; case enumDBFields.t420_idreferencia: paramName = "@t420_idreferencia"; paramType = SqlDbType.Int; paramSize = 4; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.filtro: paramName = "@filtro"; paramType = SqlDbType.VarChar; paramSize = 250; break; case enumDBFields.t001_idficepi: paramName = "@t001_idficepi"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.tipo_itemorigen: paramName = "@tipo_itemorigen"; paramType = SqlDbType.Char; paramSize = 1; break; case enumDBFields.actuocomoadministrador: paramName = "@actuocomoadministrador"; paramType = SqlDbType.Bit; paramSize = 1; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t314_loginhermes: paramName = "@t314_loginhermes"; paramType = SqlDbType.VarChar; paramSize = 25; break; case enumDBFields.t001_idficepi: paramName = "@t001_idficepi"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.itemorigen: paramName = "@tipo_item"; paramType = SqlDbType.Char; paramSize = 1; break; case enumDBFields.rowid: paramName = "@rowid"; paramType = SqlDbType.VarChar; paramSize = 50; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.ta201_idsubareapreventa: paramName = "@ta201_idsubareapreventa"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.t001_idficepi: paramName = "@t001_idficepi"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.ta203_figura: paramName = "@ta203_figura"; paramType = SqlDbType.Char; paramSize = 1; break; case enumDBFields.datatable: paramName = "@TABLAFIGURAS"; paramType = SqlDbType.Structured; paramSize = 4; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }
private SqlParameter Param(enumDBFields dbField, object value) { SqlParameter dbParam = null; string paramName = null; SqlDbType paramType = default(SqlDbType); int paramSize = 0; ParameterDirection paramDirection = ParameterDirection.Input; switch (dbField) { case enumDBFields.t001_idficepi: paramName = "@t001_idficepi"; paramType = SqlDbType.Int; paramSize = 4; break; case enumDBFields.profesional: paramName = "@profesional"; paramType = SqlDbType.VarChar; paramSize = 50; break; case enumDBFields.lista: paramName = "@lista"; paramType = SqlDbType.VarChar; break; case enumDBFields.contenedor: paramName = "@contenedor"; paramType = SqlDbType.Int; paramSize = 4; break; } dbParam = cDblib.dbParameter(paramName, paramType, paramSize); dbParam.Direction = paramDirection; if (paramDirection == ParameterDirection.Input | paramDirection == ParameterDirection.InputOutput) { dbParam.Value = value; } return(dbParam); }