Exemplo n.º 1
0
        //----------------------------------------------------------------
        //Get Value for CampoSelect, NameTabla, CampoWhere, Condicion
        //----------------------------------------------------------------
        public DataTable Get_Value_Table(BE_ReqObtieneValue Request)
        {
            DataTable dt = 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 = "[usp_Get_Value_Table]";
                        cm.CommandType = CommandType.StoredProcedure;
                        cm.Parameters.AddWithValue("CampoSelect", Request.CampoSelect);
                        cm.Parameters.AddWithValue("NameTabla", Request.NameTabla);
                        cm.Parameters.AddWithValue("CampoWhere", Request.CampoWhere);
                        cm.Parameters.AddWithValue("nFlag", Request.nFlag);
                        cm.Parameters.AddWithValue("Condicion", Request.Condicion);
                        cm.Connection = cn;

                        using (SqlDataReader dr = cm.ExecuteReader())
                            dt.Load(dr);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(dt);
        }
Exemplo n.º 2
0
        //----------------------------------------------------------------
        //Get Value for CampoSelect, NameTabla, CampoWhere, Condicion
        //----------------------------------------------------------------
        public DataTable Get_Value_Table(string CampoSelect, string NameTabla, string CampoWhere, int nFlag, string Condicion)
        {
            BE_ReqObtieneValue Request = new BE_ReqObtieneValue();
            DA_Sistema         Obj     = new DA_Sistema();

            Request.CampoSelect = CampoSelect;
            Request.NameTabla   = NameTabla;
            Request.CampoWhere  = CampoWhere;
            Request.nFlag       = nFlag;
            Request.Condicion   = Condicion;

            return(Obj.Get_Value_Table(Request));
        }