/// <summary> /// Ends the manual commands transactions. /// </summary> /// <param name="InsertExtraCommand">if set to <c>true</c> [insert extra command].</param> public static void EndManualCommandsTransactions(bool InsertExtraCommand) { string sql = string.Format("INSERT INTO [CommandsTransaction]([Agent],[Command], [RecLoc], [DateCreated],[AreaGUID] ) VALUES ('{0}' ,'{1}','{2}','{3}','{4}')", Login.Agent, "XXXXXX", Common.CurrentPNR, DateTime.Now.ToString("yyyy-dd-MM HH:mm:ss"), Common.CurrentArea); CurrentCommandsSQL.Add(sql); EndManualCommandsTransactions(); }
public static void EndManualCommandsTransactions() { return; StringBuilder sbSQL = new StringBuilder(); List <string> listSQL = CurrentCommandsSQL; string currentFileName = GlobalConstants.CurrentFileName; foreach (string sql in listSQL) { sbSQL.Append(sql); } /*****************/ CurrentCommandsSQL.Clear(); GlobalConstants.CurrentFileName = string.Empty; IsManualCommandTransactions = false; /*****************/ DirectoryInfo dir = new DirectoryInfo(GlobalConstants.QUEUE_FILES); if (dir.Exists) { FileInfo[] fInfo = dir.GetFiles(); foreach (FileInfo f in fInfo) { sbSQL.Append(GetContentFile(f.FullName)); f.Delete(); } } string fName = GlobalConstants.TEMP_FILES + "\\" + currentFileName; if (File.Exists(fName)) { sbSQL.Append(GetContentFile(fName)); File.Delete(fName); } //foreach (string sql in listSQL) // sbSQL.Append(sql); //CurrentCommandsSQL.Clear(); //GlobalConstants.CurrentFileName = string.Empty; //IsManualCommandTransactions = false; CatTransactionBL.AddCommandsTransaction(sbSQL.ToString()); IsActivatedManualCommandTransaction = false; }