public ParametroIndicadorBE RegistrarMedidaMitigacionDetalle(ParametroIndicadorBE entidad)
        {
            try
            {
                using (IDbConnection db = new OracleConnection(CadenaConexion))
                {
                    string sp = sPackage + "USP_INS_M_INDICADOR";
                    var    p  = new OracleDynamicParameters();
                    p.Add("pID_MEDMIT", entidad.ID_MEDMIT);
                    p.Add("pID_ENFOQUE", entidad.ID_ENFOQUE);
                    p.Add("pID_TIPO_CONTROL", entidad.Parametro.ID_TIPO_CONTROL);
                    p.Add("pID_PARAMETRO", entidad.Parametro.ID_PARAMETRO);
                    p.Add("pID_GRUPO_INDICADOR", entidad.Parametro.ID_GRUPO_INDICADOR);
                    p.Add("pID_ORDEN", entidad.Parametro.ID_ORDEN);
                    p.Add("pFORMULA", entidad.Parametro.FORMULA);
                    p.Add("pFORMULA_ARMADO", entidad.Parametro.FORMULA_ARMADO);
                    p.Add("pCOMPORTAMIENTO", entidad.Parametro.COMPORTAMIENTO);
                    p.Add("pVALOR", entidad.Parametro.VALOR_FORMULA);
                    p.Add("pINS", entidad.Parametro.INS);
                    db.Execute(sp, p, commandType: CommandType.StoredProcedure);
                    entidad.OK = true;
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                entidad.OK = false;
            }

            return(entidad);
        }
Beispiel #2
0
        public static ParametroIndicadorBE RegistrarMedidaMitigacionDetalle(ParametroIndicadorBE entidad)
        {
            ParametroIndicadorBE ctrl = new ParametroIndicadorBE();

            foreach (var item in entidad.ListaParametro)
            {
                ctrl.Parametro  = item;
                ctrl.ID_ENFOQUE = entidad.ID_ENFOQUE;
                ctrl.ID_MEDMIT  = entidad.ID_MEDMIT;
                ctrl            = paramind.RegistrarMedidaMitigacionDetalle(ctrl);
            }

            if (!string.IsNullOrEmpty(entidad.ID_ACTIVO))
            {
                paramind.EliminarMedidaMitigacionDetalle(entidad);
            }

            return(ctrl);
        }
        public List <ParametroIndicadorBE> getParametroIndicador(ParametroIndicadorBE entidad)
        {
            List <ParametroIndicadorBE> Lista = null;

            try
            {
                using (IDbConnection db = new OracleConnection(CadenaConexion))
                {
                    string sp = sPackage + "USP_SEL_M_INDICADOR";
                    var    p  = new OracleDynamicParameters();
                    p.Add("pID_MEDMIT", entidad.ID_MEDMIT);
                    p.Add("pID_ENFOQUE", entidad.ID_ENFOQUE);
                    p.Add("pRefcursor", dbType: OracleDbType.RefCursor, direction: ParameterDirection.Output);
                    Lista = db.Query <ParametroIndicadorBE>(sp, p, commandType: CommandType.StoredProcedure).ToList();
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }

            return(Lista);
        }
        public ParametroIndicadorBE EliminarMedidaMitigacionDetalle(ParametroIndicadorBE entidad)
        {
            try
            {
                using (IDbConnection db = new OracleConnection(CadenaConexion))
                {
                    string sp = sPackage + "USP_UPD_M_INDICADOR_DEL";
                    var    p  = new OracleDynamicParameters();
                    p.Add("pID_MEDMIT", entidad.ID_MEDMIT);
                    p.Add("pID_ENFOQUE", entidad.ID_ENFOQUE);
                    p.Add("pID_ACTIVO", entidad.ID_ACTIVO);
                    db.Execute(sp, p, commandType: CommandType.StoredProcedure);
                    entidad.OK = true;
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                entidad.OK = false;
            }

            return(entidad);
        }
Beispiel #5
0
 public static List <ParametroIndicadorBE> GetMedidaMitigacionDetalle(ParametroIndicadorBE entidad)
 {
     return(paramind.getParametroIndicador(entidad));
 }