Exemplo n.º 1
0
        /// <summary>Método que representa la llamada al procedure 'Nivel_Personal_Listar'</summary>
        static public List <Entity.Nivel_Personal.Listar> Listar(Entity.Nivel_Personal Item, Cursor oCursor)
        {
            var        ResultSet = new List <Entity.Nivel_Personal.Listar>();
            SqlCommand oComando  = oCursor.ObtenerComando(Contexto.CnControlPresupuesto);
            string     Esquema   = Galeria.Conexiones[(int)Contexto.CnControlPresupuesto].EsquemaDefecto;

            oComando.CommandText = Esquema + "Nivel_Personal_Listar";
            try
            {
                SqlParameterCollection oP = oComando.Parameters;
                oP.AddWithValue("idNivel", Uso.NoNulo(Item.idNivel, DBNull.Value));
                oP.AddWithValue("codigoPersona", Uso.NoNulo(Item.codigoPersona, DBNull.Value));
                oP.AddWithValue("idEstado", Uso.NoNulo(Item.idEstado, DBNull.Value));

                using (SqlDataReader oLector = oComando.ExecuteReader())
                {
                    while (oLector.Read())
                    {
                        var LItem = new Entity.Nivel_Personal.Listar();
                        LItem.idNivel       = (string)oLector["idNivel"];
                        LItem.codigoPersona = (string)oLector["codigoPersona"];
                        LItem.idEstado      = (string)Uso.NoNulo(oLector["idEstado"]);
                        ResultSet.Add(LItem);
                    }
                }
                return(ResultSet);
            }
            catch (System.Exception)
            {
                throw;
            }
        }
Exemplo n.º 2
0
        /// <summary>Método que representa la llamada al procedure 'Nivel_Personal_Insertar'</summary>
        static public int Insertar(Entity.Nivel_Personal Item, Cursor oCursor)
        {
            SqlCommand oComando = oCursor.ObtenerComando(Contexto.CnControlPresupuesto);
            string     Esquema  = Galeria.Conexiones[(int)Contexto.CnControlPresupuesto].EsquemaDefecto;

            oComando.CommandText = Esquema + "Nivel_Personal_Insertar";
            try
            {
                SqlParameterCollection oP = oComando.Parameters;
                oP.AddWithValue("idNivel", Uso.NoNulo(Item.idNivel, DBNull.Value));
                oP.AddWithValue("codigoPersona", Uso.NoNulo(Item.codigoPersona, DBNull.Value));
                oP.AddWithValue("idEstado", Uso.NoNulo(Item.idEstado, DBNull.Value));

                int NumFila = oComando.ExecuteNonQuery();

                return(NumFila);
            }
            catch (System.Exception)
            {
                throw;
            }
        }