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()])); }
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"); }
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); }
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); }