private void cmdSubmit_Click(object sender, EventArgs e) { ArrayList prins = ucSectionExpl.Principals; ArrayList tests = GetTests(); string warnings=""; int asstID = Convert.ToInt32(HttpContext.Current.Request.Params["AsstID"]); AutoJobs jobs = new AutoJobs(Globals.CurrentIdentity); Principals aprins = new Principals(Globals.CurrentIdentity); foreach (int prin in prins) { foreach (int evalid in tests) { try { Components.Submission sub = aprins.GetLatestSubmission(prin, asstID); if (sub == null) { warnings += aprins.GetInfo(prin).Name + " "; break; } else jobs.Create(txtName.Text, evalid, sub.ID); } catch (DataAccessException er) { PageError(er.Message); return; } } } PageError("Job: " + txtName.Text + " created successfully. Refer to the " + "job status page to monitor its progress through the testing centers. Users/Groups: " + warnings + " do not have any submissions and tests will not be run on them."); }
private void lnkRunTest_Click(object sender, EventArgs e) { AutoJobs ajobda = new AutoJobs(Globals.CurrentIdentity); Components.Submission sub = new Submissions(Globals.CurrentIdentity).GetInfo(GetSubID()); Evaluation eval = new Evaluations(Globals.CurrentIdentity).GetInfo(Convert.ToInt32(lblEvalID.Text)); string name = new FileSystem(Globals.CurrentIdentity).GetFile(sub.LocationID).Alias + " (" + eval.Name + ")"; try { AutoJob job = ajobda.Create(name, sub.AsstID); ajobda.CreateTest(job.ID, sub.ID, eval.ID, false); } catch (DataAccessException er) { PageRunError(er.Message); return; } PageRunError("Automatic job created successfully!"); }
private void cmdSubmit_Click(object sender, EventArgs e) { ArrayList prins = GetPrincipals(); ArrayList tests = GetTests(); AutoJobs jobs = new AutoJobs(Globals.CurrentIdentity); Principals aprins = new Principals(Globals.CurrentIdentity); //Check for nothing if (tests.Count == 0 || prins.Count == 0) { PageAutoError("Must select at least one user and one test to create an auto job"); return; } AutoJob job = jobs.Create(txtName.Text, GetAsstID()); foreach (int prin in prins) { foreach (int evalid in tests) { try { Components.Submission sub = aprins.GetLatestSubmission(prin, GetAsstID()); if (sub != null) { jobs.CreateTest(job.ID, sub.ID, evalid, false); } } catch (DataAccessException er) { PageAutoError(er.Message); return; } } } mpViews.SelectedIndex = 1; }