public async Task <bool> attemptNewLogin(string u, string p, bool s) { this.Responded = false; TaskCallback call = new TaskCallback(response); string statement = string.Concat(new string[] { "SELECT IDKey,AgentNum FROM agents WHERE Username='******'AND Password='******';" }); DatabaseFunctions.SendToPhp(false, statement, call); while (!Responded) { await Task.Delay(50); } bool result; if (dict.Count > 1) { if (s) { writeUserDataToFile(u, p); } result = true; } else { result = false; } return(result); }
public FileList(int cusID) : base() { customer = cusID; string sql = "SELECT cusfields.Value,cusindex.Name FROM cusfields INNER JOIN cusindex ON cusfields.CusID=cusindex.IDKey WHERE cusindex.IDKey='" + cusID + "' AND cusfields.Index LIKE '%dress%'"; TaskCallback call = populateGrid; DatabaseFunctions.SendToPhp(false, sql, call); GridFiller.rapidFill(new string[] { "Associated Files" }, this); }
public void response(string result) { string[] input = FormatFunctions.SplitToPairs(result); dict = FormatFunctions.createValuePairs(input); Responded = true; if (dict.Count > 1) { ClientData.AgentIDK = int.Parse(dict["IDKey"][0]); string sql = "SELECT PermissionGranted FROM agentpermissions WHERE AgentID='" + AgentIDK + "'"; TaskCallback call = loadSecurityKeys; DatabaseFunctions.SendToPhp(false, sql, call); string sql2 = "SELECT AgentRole FROM agentroles WHERE AgentID='" + AgentIDK + "'"; TaskCallback call2 = loadRoles; DatabaseFunctions.SendToPhp(false, sql2, call2); } }
public async static Task <string> smartsearch(string term, string table) { Responded = false; TaskCallback call = boolSetter; string sql = "SELECT smartStatement FROM smartsearch WHERE table='" + table + "' AND term='" + term + "';"; DatabaseFunctions.SendToPhp(false, sql, call); while (!Responded) { await Task.Delay(50); } string toReturn = ""; if (dict.Count > 0) { foreach (string s in dict["smartStatement"]) { toReturn += " OR " + s; } } return(toReturn); }
public async Task <bool> attemptSavedLoginAsync() { Responded = false; loadUserDatafromFile(); TaskCallback call = response; string statement = "SELECT IDKey,AgentNum FROM agents WHERE Username='******'AND Password='******';"; DatabaseFunctions.SendToPhp(false, statement, call); while (!Responded) { await Task.Delay(50); } bool result; if (dict.Count > 1) { result = true; } else { result = false; } return(result); }