public void import() { string sql = "SELECT * FROM cusfields WHERE cusfields.Index<>'Phone' AND cusfields.Index<>'Address' AND cusfields.Index<>'Source' AND cusfields.Index<>'Modified On' AND cusfields.Index<>'Notes' AND cusfields.Index<>'Region' AND cusfields.Index<>'Created On' AND cusfields.Index<>'Email' AND TaskID IS NULL"; TaskCallback call = archiveCusfields; DatabaseFunctions.SendToPhp(false, sql, call); }
public static void LoadAgentDictionary() { string sql = "SELECT IDKey, FName FROM agents WHERE Active='1'"; TaskCallback call = populateDictionary; DatabaseFunctions.SendToPhp(false, sql, call); }
public async Task <bool> attemptNewLogin(string u, string p, bool s) { this.Responded = false; TaskCallback call = new TaskCallback(response); string statement = "SELECT IDKey,AgentNum FROM agents WHERE Username='******'AND Password='******';"; DatabaseFunctions.SendToPhp(false, statement, call); while (!Responded) { await Task.Delay(5); } bool result; if (dict.Count > 1) { if (s) { writeUserDataToFile(u, p); } result = true; } else { result = false; } return(result); }
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); } }
public void archiveCusfields(string result) { List <String> list = new List <String>(); cusFieldArchive = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result)); if (cusFieldArchive.Count > 0) { for (int i = 0; i < cusFieldArchive["Index"].Count; i++) { //These lines move Data from Cusfields to Jobfiels, Never needs to be run again! /*string x = "INSERT INTO jobfields (JobID,jobfields.Index,jobfields.Value,AdvValue) VALUES ('" + cusFieldArchive["CusID"][i] + "','" + cusFieldArchive["Index"][i] + "','" + cusFieldArchive["Value"][i] + "','" + cusFieldArchive["AdvValue"][i] + "')"; * list.Add(x); * string y = "UPDATE cusfields SET TaskID='999999' WHERE IDKey='"+cusFieldArchive["IDKey"][i]+"'"; * list.Add(y);*/ } } DatabaseFunctions.SendBatchToPHP(list); }
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); }