public static void dumpData(string url, string UserSelectedTable, string[] Columns) { var FileName = ""; if (!String.IsNullOrEmpty((FileName = UserInteraction.takeInputForTableFileGeneration()))) { var XAML = XML.addRoot(ResponseFilter.getPureResponse(HTTPMethods.getResponse(QueryCrafter.constructQueryForDataDump(url, UserSelectedTable, QueriesDB.TableDumpQuery)))); dumpXML(XAML, UserSelectedTable, FileName, Columns); Log.logNotification("If ur unable to see table Data, dont worry I've another method.."); UserInteraction.promptForUserInput("Press 'n' to try another method OR Press any key to continue.."); var UserInput = Console.ReadLine(); if (UserInput.ToLower() == "n") { XAML = XML.addRoot(ResponseFilter.getPureResponseWithLastIndex(HTTPMethods.getResponse(QueryCrafter.constructQueryForDataDump(url, UserSelectedTable, QueriesDB.TableDumpQuery)))); dumpXML(XAML, UserSelectedTable, FileName, Columns); } Log.logNotification("Data dump complete.. and if no data is displayed to you.. table might be empty.. Press any key to continue.."); Console.ReadKey(); } FileIO.deleteTempFile("tmp.txt"); }
public static void SaveFile(string fileContents) { string fileName = UserInteraction.takeInputForTableFileGeneration(); FileIO.createWriteFile(fileContents, fileName); Log.logOutput("File saved with name : " + fileName); }