Exemplo n.º 1
0
        public static bool VerifyIfEnabled(string sUser)
        {
            DatabaseHelper dh = new DatabaseHelper();

            DataRow[] drs = dh.RunQuery($"SELECT enabled FROM [User] WHERE uName = '{sUser}'");

            return(Convert.ToBoolean(drs[0]["enabled".ToString()]));
        }
Exemplo n.º 2
0
        public static bool VerifyIfProjectManager(string sUser)
        {
            DatabaseHelper dh = new DatabaseHelper();

            return(dh.RunQuery($"SELECT role FROM [User] WHERE uName = '{sUser}'")[0]["role"].ToString() == "Project Manager");
        }
Exemplo n.º 3
0
        public static bool VerifyIfPartOfProject(string username, int projectId)
        {
            DatabaseHelper dh = new DatabaseHelper();

            return(dh.RunQuery($"SELECT * FROM User_Project WHERE uName = '{username}' AND projectId = '{projectId}'").Count() == 1);
        }
Exemplo n.º 4
0
        public static bool VerifyCredentials(string sUser, string sPassword)
        {
            DatabaseHelper dh = new DatabaseHelper();

            return(dh.RunQuery($"SELECT * FROM [User] WHERE uName = '{sUser}' AND password = '******'").Count() == 1);
        }