示例#1
0
        public DataTable GetConstante(BE_Req_Constante Request)
        {
            DataTable Item = new DataTable();

            try
            {
                clsConection Obj    = new clsConection();
                string       Cadena = Obj.GetConexionString("Naylamp");

                using (SqlConnection cn = new SqlConnection(Cadena))
                {
                    cn.Open();

                    using (SqlCommand cm = new SqlCommand())
                    {
                        cm.CommandText = "sp_Get_Constantes_BynConCodigo";
                        cm.CommandType = CommandType.StoredProcedure;
                        cm.Parameters.AddWithValue("nConCodigo", Request.nConCodigo);
                        cm.Parameters.AddWithValue("cConValor", Request.cConValor);
                        cm.Connection = cn;
                        using (SqlDataReader dr = cm.ExecuteReader())
                        {
                            Item.Load(dr);
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(Item);
        }
示例#2
0
        public IList <BE_Res_Constante> Get_ConstantesBynConValor(BE_Req_Constante Request)
        {
            BE_Res_Constante Item = new BE_Res_Constante();
            var lista             = new List <BE_Res_Constante>();

            try
            {
                clsConection Obj    = new clsConection();
                string       Cadena = Obj.GetConexionString("Naylamp");

                using (SqlConnection cn = new SqlConnection(Cadena))
                {
                    cn.Open();

                    using (SqlCommand cm = new SqlCommand())
                    {
                        cm.CommandText = "sp_Get_Constantes_BynConCodigo";
                        cm.CommandType = CommandType.StoredProcedure;
                        cm.Parameters.AddWithValue("nConCodigo", Request.nConCodigo);
                        cm.Parameters.AddWithValue("cConValor", Request.cConValor);
                        cm.Connection = cn;
                        using (SqlDataReader dr = cm.ExecuteReader())
                        {
                            lista.Clear();
                            while (dr.Read())
                            {
                                Item                 = new BE_Res_Constante();
                                Item.nConValor       = dr.GetInt32(dr.GetOrdinal("nConValor"));
                                Item.cConDescripcion = dr.GetString(dr.GetOrdinal("cConDescripcion")).Trim();
                                Item.nConCodigo      = dr.GetInt32(dr.GetOrdinal("nConCodigo"));
                                lista.Add(Item);
                            }
                            dr.Close();
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(lista);
        }
示例#3
0
        public DataTable GetConstante(BE_Req_Constante Request)
        {
            DAConstante ObjConstantes = new DAConstante();

            return(ObjConstantes.GetConstante(Request));
        }
示例#4
0
        public IList <BE_Res_Constante> Get_ConstantesBynConValor(BE_Req_Constante Request)
        {
            DAConstante ObjConstantes = new DAConstante();

            return(ObjConstantes.Get_ConstantesBynConValor(Request));
        }
示例#5
0
        public DataTable ListarConstantes(BE_Req_Constante Request)
        {
            DAConstante ObjConstantes = new DAConstante();

            return(ObjConstantes.ListarConstantes(Request));
        }