public string readSettingFromDB() { //string userName = Environment.UserName; //String projectDirectory = Environment.CurrentDirectory; //string filepath = Directory.GetParent(projectDirectory).Parent.FullName; //String[] paths = new string[] { @filepath, "files" }; //filepath = Path.Combine(paths); //string setting = ""; //DirectoryInfo d = new DirectoryInfo(filepath);//Assuming Test is your Folder ////ShowErrorDialog("filepath is: \n" + filepath); //if (!Directory.Exists(filepath)) //{ // return ""; //} //using (StreamReader sr = System.IO.File.OpenText(Path.Combine(filepath, "setting_" + userName + ".txt"))) //{ // sr.ReadLine(); // sr.ReadLine(); // //ShowErrorDialog("id\n" + id); // string line = ""; // while ((line = sr.ReadLine()) != null) // { // //ShowErrorDialog("line\n" + line); // setting += line + "\r\n"; // } //} DBclient DBInstance = DBclient.Instance; string setting = DBInstance.getGeneralDetailsTable("setting"); return(setting); }
public static string getReportString() { DBclient DBInstance = DBclient.Instance; string settingString = DBInstance.getGeneralDetailsTable("lastReport"); return(settingString); }
private bool connectToExistClient() { DBclient DBInstance = DBclient.Instance; ip = DBInstance.getGeneralDetailsTable("ip"); string setting = DBInstance.getGeneralDetailsTable("setting"); Console.WriteLine("setting: " + setting + "\nip: " + ip); if (setting.Length > 0) { id = DBInstance.getGeneralDetailsTable("id"); Console.WriteLine("connectToExistClient - RECONNECT"); reConnect(); playAllTrigers(); return(true); } return(false); }