Esempio n. 1
0
        public static DataTable getAllPostNeedApprove()
        {
            string sql = @"select [Post].postid, [Account].username, [Category].categoryname, [Post].isApprove, " +
                         " [Platform].platformname, [Post].title, [Post].content, [Post].image, " +
                         " [Post].upvote, [Post].datecreated " +
                         " from Post, Category, [Platform], [Account] " +
                         " where [Post].categoryid = [Category].categoryid and [Post].platformid = [Platform].platformid " +
                         " and [Post].writtername = [Account].username and [Post].isApprove = 0 ";

            return(DAO.GetDataBySQL(sql));
        }
Esempio n. 2
0
        public static DataTable getAllAccountByNameAndIsWriter(string username, int isWriter)
        {
            string sql = @"  select * from Account where [Account].isAdmin = 0 and [Account].username like N'%" + username + "%' ";

            if (isWriter != 0)
            {
                sql += " and [Account].isWriter = @writer";
                SqlParameter p1 = new SqlParameter("@writer", SqlDbType.Int);
                p1.Value = isWriter;
                return(DAO.GetDataBySQLWithParameters(sql, p1));
            }
            return(DAO.GetDataBySQL(sql));
        }
Esempio n. 3
0
        public static DataTable getAllAccount()
        {
            string sql = "select * from Account ";

            return(DAO.GetDataBySQL(sql));
        }
Esempio n. 4
0
        public static DataTable getAllCategory()
        {
            string sql = "select * from [Category] ";

            return(DAO.GetDataBySQL(sql));
        }
Esempio n. 5
0
        public static DataTable getAllPlatform()
        {
            string sql = "  select * from [Platform] ";

            return(DAO.GetDataBySQL(sql));
        }