internal static List <JobO> SelectJobsToBeExecuted() { List <JobO> jList = new List <JobO>(); OpenConnection(); SqlCommand getJ = new SqlCommand(" SELECT * FROM Job WHERE ExecutionTime < DATEADD(second,30,getdate()) AND ExecutionTime > DATEADD(second,-30,getdate())", myConnection); SqlDataReader reader = getJ.ExecuteReader(); while (reader.Read()) { JobO j = new JobO(); j.JobID = reader.GetInt32(0); j.JobName = reader.GetString(6); j.Priority = reader.GetByte(5); j.ResourceID = reader.GetInt32(1); j.Deadline = reader.GetDateTime(3); j.Created = reader.GetDateTime(4); j.CreatedUserID = reader.GetInt32(2); jList.Add(j); } CloseConnection(); return(jList); }
private void ExecuteDummyScript(string ResourceScript, JobO jobToExecute) { lbl_output.Text = lbl_output.Text + jobToExecute.JobName + " is executed\n"; }