Esempio n. 1
0
        public void InsertFromClipBoard(int index)
        {
            var text = Clipboard.GetText();
            var data = text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);

            foreach (var item in data)
            {
                var  firstCol = item.Split('\t')[0];
                bool isExists = BatchJobGroups.Any(i => i.Name == firstCol);
                if (isExists)
                {
                    Error?.Invoke("Duplicate item(s) deleted.", null);
                }
                if (firstCol != "" && !isExists)
                {
                    var bjg = new BatchJobGroup(firstCol);
                    if (index < BatchJobGroups.Count)
                    {
                        BatchJobGroups.RemoveAt(index);
                        BatchJobGroups.Insert(index, bjg);
                    }
                    else
                    {
                        BatchJobGroups.Add(bjg);
                    }
                    index++;
                }
            }
        }
Esempio n. 2
0
        public void ExtractLogs(BatchJobGroup bjg)
        {
            string        query         = File.ReadAllText("getLog.query");
            var           masterSession = OpenConnection("Master");
            var           testSession   = OpenConnection("Test");
            OracleCommand masterCmd     = new OracleCommand(query, masterSession.OracleConnection);
            OracleCommand testCmd       = new OracleCommand(query, testSession.OracleConnection);

            masterCmd.Parameters.Add(":bjgName", OracleDbType.Varchar2).Value   = bjg.Name;
            masterCmd.Parameters.Add(":fromDate", OracleDbType.TimeStamp).Value = FromDate;
            testCmd.Parameters.Add(":bjgName", OracleDbType.Varchar2).Value     = bjg.Name;
            testCmd.Parameters.Add(":fromDate", OracleDbType.TimeStamp).Value   = FromDate;
            var masterExtract = masterSession.AsyncGetBJGLogs(masterCmd);
            var testExtract   = testSession.AsyncGetBJGLogs(testCmd);

            bjg.AddMasterLogLines(masterExtract);
            bjg.AddTestLogLines(testExtract);
            masterSession.CloseConnection();
            testSession.CloseConnection();
        }
Esempio n. 3
0
 public string LoadFromScope()
 {
     try {
         if (!File.Exists(pathScopeFile))
         {
             return("Scope file not yet defined.");
         }
         var names = File.ReadAllLines(pathScopeFile);
         if (!names.Any())
         {
             return("Scope file is empty.");
         }
         BatchJobGroups.Clear();
         foreach (var name in names)
         {
             var bjg = new BatchJobGroup(name);
             BatchJobGroups.Add(bjg);
         }
         return("");
     } catch (Exception ex) {
         return(ex.Message);
     }
 }