Exemplo n.º 1
0
        public List <IPCCBE> ListarIPCCPaginado(IPCCBE entidad)
        {
            List <IPCCBE> Lista = null;

            try
            {
                using (IDbConnection db = new OracleConnection(CadenaConexion))
                {
                    string sp = sPackage + "USP_SEL_BUSCAR_IPCC";
                    var    p  = new OracleDynamicParameters();
                    p.Add("pBuscar", entidad.buscar);
                    p.Add("pRegistros", entidad.cantidad_registros);
                    p.Add("pPagina", entidad.pagina);
                    p.Add("pSortColumn", entidad.order_by);
                    p.Add("pSortOrder", entidad.order_orden);
                    p.Add("pRefcursor", dbType: OracleDbType.RefCursor, direction: ParameterDirection.Output);
                    Lista = db.Query <IPCCBE>(sp, p, commandType: CommandType.StoredProcedure).ToList();
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }

            return(Lista);
        }
Exemplo n.º 2
0
        public IPCCBE RegistrarIPCC(IPCCBE entidad)
        {
            int cod = 0;

            try
            {
                using (IDbConnection db = new OracleConnection(CadenaConexion))
                {
                    string sp         = sPackage + "USP_INS_IPCC";
                    var    parametros = new OracleParameter[2];
                    parametros[0] = new OracleParameter("pIPCC", entidad.IPCC);
                    parametros[1] = new OracleParameter("pID_IPCC", OracleDbType.Int32, ParameterDirection.Output);
                    OracleHelper.ExecuteNonQuery(CadenaConexion, CommandType.StoredProcedure, sp, parametros);
                    cod             = int.Parse(parametros[1].Value.ToString());
                    entidad.ID_IPCC = cod;
                    entidad.OK      = true;
                }
            }
            catch (Exception ex)
            {
                entidad.extra = ex.Message;
                Log.Error(ex);
            }

            return(entidad);
        }
Exemplo n.º 3
0
 public static List <IPCCBE> ListarIPCCExcel(IPCCBE entidad)
 {
     if (string.IsNullOrEmpty(entidad.buscar))
     {
         entidad.buscar = "";
     }
     return(ipcc.ListarIPCCExcel(entidad));
 }
Exemplo n.º 4
0
        public IPCCBE GetIPCCPorId(IPCCBE entidad)
        {
            try
            {
                using (IDbConnection db = new OracleConnection(CadenaConexion))
                {
                    string sp = sPackage + "USP_GET_IPCC";
                    var    p  = new OracleDynamicParameters();
                    p.Add("pID_IPCC", entidad.ID_IPCC);
                    p.Add("pRefcursor", dbType: OracleDbType.RefCursor, direction: ParameterDirection.Output);
                    entidad = db.Query <IPCCBE>(sp, p, commandType: CommandType.StoredProcedure).FirstOrDefault();
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }

            return(entidad);
        }
Exemplo n.º 5
0
        public List <IPCCBE> ListaIPCCControl(IPCCBE entidad)
        {
            List <IPCCBE> Lista = null;

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

            return(Lista);
        }
Exemplo n.º 6
0
        public IPCCBE EliminarIPCC(IPCCBE entidad)
        {
            try
            {
                using (IDbConnection db = new OracleConnection(CadenaConexion))
                {
                    string sp         = sPackage + "USP_DEL_IPCC";
                    var    parametros = new OracleParameter[1];
                    parametros[0] = new OracleParameter("pID_IPCC", entidad.ID_IPCC);
                    OracleHelper.ExecuteNonQuery(CadenaConexion, CommandType.StoredProcedure, sp, parametros);
                    entidad.OK = true;
                }
            }
            catch (Exception ex)
            {
                entidad.extra = ex.Message;
                Log.Error(ex);
            }

            return(entidad);
        }
Exemplo n.º 7
0
 public static IPCCBE EliminarIPCC(IPCCBE entidad)
 {
     return(ipcc.EliminarIPCC(entidad));
 }
Exemplo n.º 8
0
 public static IPCCBE ActualizarIPCC(IPCCBE entidad)
 {
     return(ipcc.ActualizarIPCC(entidad));
 }
Exemplo n.º 9
0
 public static IPCCBE RegistrarIPCC(IPCCBE entidad)
 {
     return(ipcc.RegistrarIPCC(entidad));
 }
Exemplo n.º 10
0
 public static IPCCBE GetIPCCPorId(IPCCBE entidad)
 {
     return(ipcc.GetIPCCPorId(entidad));
 }
Exemplo n.º 11
0
 public static List <IPCCBE> ListaIPCCControl(IPCCBE entidad)
 {
     return(ipcc.ListaIPCCControl(entidad));
 }