Пример #1
0
        public static bool checkUsername(String username)
        {
            String    sql = "Select * from [User] where UserName = '******'";
            DataTable dt  = DAO.GetDataTable(sql);

            return(dt.Rows.Count == 0 ? true : false);
        }
Пример #2
0
        public static int getIDMax()
        {
            String sql = "SELECT max(orderid) from Orders";

            try
            {
                DataTable dt = DAO.GetDataTable(sql);
                foreach (DataRow rd in dt.Rows)
                {
                    return(int.Parse(rd[0].ToString()));
                }
            }catch (Exception ex)
            {
                return(-1);
            }

            return(-1);
        }
Пример #3
0
        public static DataTable GetAlbum(int genreid, int artistid)
        {
            String sql = "SELECT albumid, title, price, albumurl FROM Albums";

            if (genreid != -1 && artistid != -1)
            {
                sql += " WHERE genreid = " + genreid + " and artistid = " + artistid;
            }
            else if (genreid == -1 && artistid == -1)
            {
            }
            else if (artistid == -1)
            {
                sql += " WHERE genreid = " + genreid;
            }
            else
            {
                sql += " WHERE artistid = " + artistid;
            }
            return(DAO.GetDataTable(sql));
        }
Пример #4
0
        public static DataTable getAllGenres()
        {
            String sql = "SELECT * FROM Genres";

            return(DAO.GetDataTable(sql));
        }
Пример #5
0
        public static DataTable getLogUser(String usn, String ps)
        {
            String sql = "Select * from [User] where UserName = '******' and Password = '******'";

            return(DAO.GetDataTable(sql));
        }
Пример #6
0
        public static DataTable getAllArtist()
        {
            String sql = "SELECT * FROM Artists";

            return(DAO.GetDataTable(sql));
        }