コード例 #1
0
        public static DataTable Query <T>(int id)
        {
            //select * from admin
            String sql = $"select * from {typeof(T).Name} where {typeof(T).GetProperty(id.ToString())} = '{id}'";

            return(Sqlhelp.Query(sql, null));
        }
コード例 #2
0
        public static void Query <T>(string name)
        {
            //select * from admin
            String sql = $"select * from {typeof(T).Name} where {typeof(T).GetProperty(name)} like '{name}'";

            Sqlhelp.Query(sql);
        }
コード例 #3
0
        public static DataTable Query <T>()
        {
            //select * from admin
            String sql = $"select * from {typeof(T).Name}";

            return(Sqlhelp.Query(sql, null));
        }
コード例 #4
0
        public static void Query <T>(bool l)
        {
            string sql = "";

            //select * from admin
            if (l)
            {
                sql = $"select * from {typeof(T).Name} order by updatetime";
                Sqlhelp.Query(sql);
            }
            else
            {
                sql = $"select * from {typeof(T).Name} order by updatetime desc";
            }
            Sqlhelp.Query(sql);
        }