- Timestamp:
- 05/28/09 17:33:37 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Console/3.2/AddJobForm.cs
r1753 r1937 42 42 public event addDelegate addJobEvent; 43 43 44 ResponseList< Job> jobGroups = null;44 ResponseList<Project> projects = null; 45 45 IJobManager jobManager; 46 IClientManager clientManager; 47 ResponseList<ClientGroup> clientGroups; 48 49 Dictionary<Guid, string> clients = null; 46 50 47 51 public AddJobForm() { 48 52 InitializeComponent(); 53 54 clients = new Dictionary<Guid, string>(); 49 55 AddJob(); 56 50 57 } 51 58 … … 53 60 jobManager = 54 61 ServiceLocator.GetJobManager(); 55 jobGroups = jobManager.GetAllJobs();56 cbP arJob.Items.Add("none");57 cbP arJob.SelectedIndex = 0;58 foreach ( Job job in jobGroups.List) {59 cbP arJob.Items.Add(job.Id);62 projects = jobManager.GetAllProjects(); 63 cbProject.Items.Add("none"); 64 cbProject.SelectedIndex = 0; 65 foreach (Project project in projects.List) { 66 cbProject.Items.Add(project.Name); 60 67 } 68 69 70 } 71 72 private void AddClientGroups() { 73 foreach (ClientGroup cg in clientGroups.List) { 74 clients.Add(cg.Id, cg.Name); 75 AddClientOrGroup(cg); 76 } 77 } 78 79 private void AddClientOrGroup(ClientGroup clientGroup) { 80 foreach (Resource resource in clientGroup.Resources) { 81 if (resource is ClientGroup) { 82 clients.Add(resource.Id, resource.Name); 83 AddClientOrGroup(resource as ClientGroup); 84 } 85 } 86 61 87 } 62 88 … … 67 93 if (numJobs > 0) { 68 94 for (int i = 0; i < numJobs; i++) { 69 if (cbP arJob.SelectedIndex != 0) {70 foreach (Job pjob in jobGroups.List) {71 if (cbParJob.SelectedItem.ToString().Equals(pjob.Id.ToString())) {72 Job job = new Job { ParentJob = pjob, State = State.offline, CoresNeeded = 1 };73 job.SerializedJob = PersistenceManager.SaveToGZip(new TestJob());74 Response resp = jobManager.AddNewJob(job);75 }76 }77 } else {78 Job job = new Job { State = State.offline, CoresNeeded = 1 };79 job.SerializedJob = PersistenceManager.SaveToGZip(new TestJob());80 Response resp = jobManager.AddNewJob(job);95 if (cbProject.SelectedIndex != 0) { 96 // foreach (Job pjob in jobGroups.List) { 97 // if (cbParJob.SelectedItem.ToString().Equals(pjob.Id.ToString())) { 98 // Job job = new Job { ParentJob = pjob, State = State.offline, CoresNeeded = 1 }; 99 // job.SerializedJob = PersistenceManager.SaveToGZip(new TestJob()); 100 // Response resp = jobManager.AddNewJob(job); 101 // } 102 // } 103 //} else { 104 // Job job = new Job { State = State.offline, CoresNeeded = 1 }; 105 // job.SerializedJob = PersistenceManager.SaveToGZip(new TestJob()); 106 // Response resp = jobManager.AddNewJob(job); 81 107 } 82 108 } … … 99 125 } 100 126 127 private void cbAllGroups_CheckedChanged(object sender, EventArgs e) { 128 foreach (Control control in gbGroups.Controls) { 129 control.Enabled = !cbAllGroups.Checked; 130 } 131 } 132 101 133 102 134 }
Note: See TracChangeset
for help on using the changeset viewer.