private static string ContentProcess(int i, int ring, int prjKey, List <dynamic> YearList, List <dynamic> Holding, string CentralPath, string newConn) { string processPath; string args; //int key = ring + i; int year = YearList[i]; string journal = Holding[i][0]; List <string> temp = YearSwitch(i, year, journal); processPath = temp[0]; args = temp[1]; DateTime dateEx = DateTime.Now; List <int> sqlEarly = TidalWave.SQL.InsertInto(newConn, Holding[i][1], dateEx); //returns the runID and the projectTableID to send to the .csv double fileSize = IdentifyYear.FileSize(CentralPath); string csvEarly = CSVPath(CentralPath); if (File.Exists(csvEarly)) { File.Delete(csvEarly); } string sub = CSVWriter(sqlEarly, csvEarly, fileSize); int exitCode = Process.ByPathAndArguments(processPath, args); int send = sqlEarly[0]; string select = "SELECT * FROM [drRunStat] WHERE rsKey = " + send; List <dynamic> SelectComp = TidalWave.SQL.Select(newConn, select); if (SelectComp[4] == null || SelectComp[4] == "") { TidalWave.SQL.Update(dateEx, send, newConn, 2); return("Failure"); } else if (SelectComp[4] = true) { TidalWave.SQL.Update(dateEx, send, newConn, 1); return("Succes"); } else { TidalWave.SQL.Update(dateEx, send, newConn, 0); return("Failure"); }; }
private static string ContentProcess(int i, int prjKey, string Year, List <string> Holding, string CentralPath, string newConn, string SQLSelect) { string processPath; string args; //int key = ring + i; int year = Convert.ToInt32(Year); //int year = Year; string journal = Holding[0]; List <string> temp = YearSwitch(i, year, journal); processPath = temp[0]; args = temp[1]; DateTime dateEx = DateTime.Now; List <int> sqlEarly = new List <int>(); if (newConn != "" && newConn != null) { sqlEarly = TidalWave.SQL.InsertInto(newConn, Holding[1], dateEx); } //returns the runID and the projectTableID to send to the .csv double fileSize = IdentifyYear.FileSize(CentralPath); string csvEarly = CSVPath(CentralPath); if (File.Exists(csvEarly)) { File.Delete(csvEarly); } if (newConn != "" && newConn != null) { string sub = CSVWriter(sqlEarly, csvEarly, fileSize, CentralPath); } else { List <int> vs = new List <int>(); vs.Add(0); vs.Add(1); string sub = CSVWriter(vs, csvEarly, fileSize, CentralPath); } int exitCode = Process.ByPathAndArguments(processPath, args); //int send = sqlEarly[0]; if (newConn != "" && newConn != null) { string select = SQLSelect + sqlEarly[0]; List <dynamic> SelectComp = TidalWave.SQL.Select(newConn, select); if (SelectComp[4] == null || SelectComp[4] == "") { TidalWave.SQL.Update(dateEx, sqlEarly[0], newConn, 2); return("Failure"); } else if (SelectComp[4] = true) { TidalWave.SQL.Update(dateEx, sqlEarly[0], newConn, 1); return("Success"); } else { TidalWave.SQL.Update(dateEx, sqlEarly[0], newConn, 0); return("Failure"); }; } else { return(exitCode.ToString()); }; }