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)); }
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)); }
public static DataTable getAllAccount() { string sql = "select * from Account "; return(DAO.GetDataBySQL(sql)); }
public static DataTable getAllCategory() { string sql = "select * from [Category] "; return(DAO.GetDataBySQL(sql)); }
public static DataTable getAllPlatform() { string sql = " select * from [Platform] "; return(DAO.GetDataBySQL(sql)); }