Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/19/18 15:51:41 (7 years ago)
Author:
jzenisek
Message:

#2839: Fixed several bugs and added project duration handling

  • fixed project duration handling (client- & service-side)
  • fixed tagging in HiveJobAdmin
  • added ProjectJobs view (under construction)
  • added necessary service methods
Location:
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectView.cs

    r15760 r15966  
    2828using HeuristicLab.Core.Views;
    2929using HeuristicLab.MainForm;
     30using System.Drawing;
    3031
    3132namespace HeuristicLab.Clients.Hive.Administrator.Views {
     
    3536    private readonly object locker = new object();
    3637
     38    private Guid persistedOwnerUserId;
     39
    3740    public new Project Content {
    3841      get { return (Project)base.Content; }
    39       set { base.Content = value; }
     42      set { base.Content = value; persistedOwnerUserId = Content != null ? Content.OwnerUserId : Guid.Empty; }
    4043    }
    4144
     
    8285        createdTextBox.Text = Content.DateCreated.ToString("ddd, dd.MM.yyyy, HH:mm:ss");
    8386        startDateTimePicker.Value = Content.StartDate;
    84         if (indefiniteCheckBox.Checked = !Content.EndDate.HasValue) {
    85           endDateTimePicker.Value = startDateTimePicker.Value;
    86         } else {
    87           endDateTimePicker.Value = Content.EndDate.Value;
    88         }
     87
     88        indefiniteCheckBox.Checked = !Content.EndDate.HasValue;
     89        if(!indefiniteCheckBox.Checked) endDateTimePicker.Value = Content.EndDate.Value;
     90        else endDateTimePicker.Value = Content.StartDate;
     91        endDateTimePicker.Enabled = !indefiniteCheckBox.Checked;
    8992      }
    9093    }
     
    148151          ownerComboBox.SelectedIndexChanged -= ownerComboBox_SelectedIndexChanged;
    149152          ownerComboBox.DataSource = AccessClient.Instance.UsersAndGroups.OfType<LightweightUser>().ToList();
    150           ownerComboBox.SelectedItem = AccessClient.Instance.UsersAndGroups.FirstOrDefault(x => x.Id == Content.OwnerUserId);
     153          ownerComboBox.SelectedItem = AccessClient.Instance.UsersAndGroups.FirstOrDefault(x => x.Id == persistedOwnerUserId);
    151154          ownerComboBox.SelectedIndexChanged += ownerComboBox_SelectedIndexChanged;
    152155          refreshButton.Enabled = true;
     
    201204      if (Content == null) return;
    202205      var newEndDate = indefiniteCheckBox.Checked ? (DateTime?)null : Content.StartDate;
    203       if (Content.EndDate != newEndDate)
     206      endDateTimePicker.Enabled = !indefiniteCheckBox.Checked;
     207      if (Content.EndDate != newEndDate) {
     208        DeregisterContentEvents();
    204209        Content.EndDate = newEndDate;
     210        endDateTimePicker.Value = newEndDate.HasValue ? newEndDate.Value : Content.StartDate;
     211        RegisterContentEvents();
     212      }
    205213    }
    206214    #endregion
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectsView.Designer.cs

    r15953 r15966  
    3939      this.resourcesTabPage = new System.Windows.Forms.TabPage();
    4040      this.projectResourcesView = new HeuristicLab.Clients.Hive.Administrator.Views.ProjectResourcesView();
     41      this.jobsTabPage = new System.Windows.Forms.TabPage();
     42      this.projectJobsView = new HeuristicLab.Clients.Hive.Administrator.Views.ProjectJobsView();
    4143      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    4244      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
     
    4850      this.permissionsTabPage.SuspendLayout();
    4951      this.resourcesTabPage.SuspendLayout();
     52      this.jobsTabPage.SuspendLayout();
    5053      this.SuspendLayout();
    5154      //
     
    152155      this.tabControl.Controls.Add(this.permissionsTabPage);
    153156      this.tabControl.Controls.Add(this.resourcesTabPage);
     157      this.tabControl.Controls.Add(this.jobsTabPage);
    154158      this.tabControl.Location = new System.Drawing.Point(3, 3);
    155159      this.tabControl.Name = "tabControl";
     
    225229      this.projectResourcesView.Size = new System.Drawing.Size(571, 509);
    226230      this.projectResourcesView.TabIndex = 0;
     231      //
     232      // jobsTabPage
     233      //
     234      this.jobsTabPage.Controls.Add(this.projectJobsView);
     235      this.jobsTabPage.Location = new System.Drawing.Point(4, 22);
     236      this.jobsTabPage.Name = "jobsTabPage";
     237      this.jobsTabPage.Padding = new System.Windows.Forms.Padding(3);
     238      this.jobsTabPage.Size = new System.Drawing.Size(577, 515);
     239      this.jobsTabPage.TabIndex = 3;
     240      this.jobsTabPage.Text = "Jobs";
     241      this.jobsTabPage.UseVisualStyleBackColor = true;
     242      //
     243      // projectJobsView
     244      //
     245      this.projectJobsView.Caption = "ProjectView";
     246      this.projectJobsView.Content = null;
     247      this.projectJobsView.Dock = System.Windows.Forms.DockStyle.Fill;
     248      this.projectJobsView.Location = new System.Drawing.Point(3, 3);
     249      this.projectJobsView.Name = "projectJobsView";
     250      this.projectJobsView.ReadOnly = false;
     251      this.projectJobsView.Size = new System.Drawing.Size(571, 509);
     252      this.projectJobsView.TabIndex = 0;
    227253      //
    228254      // ProjectsView
     
    242268      this.permissionsTabPage.ResumeLayout(false);
    243269      this.resourcesTabPage.ResumeLayout(false);
     270      this.jobsTabPage.ResumeLayout(false);
    244271      this.ResumeLayout(false);
    245272
     
    260287    private System.Windows.Forms.ImageList imageList;
    261288    private System.Windows.Forms.TabPage resourcesTabPage;
     289    private System.Windows.Forms.TabPage jobsTabPage;
    262290    private ProjectResourcesView projectResourcesView;
    263291    private ProjectPermissionsView projectPermissionsView;
     292    private ProjectJobsView projectJobsView;
    264293    private System.Windows.Forms.ToolTip toolTip;
    265294  }
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectsView.cs

    r15953 r15966  
    100100        projectPermissionsView.Content = null;
    101101        projectResourcesView.Content = null;
     102        projectJobsView.Content = null;
    102103      } else {
    103104        BuildProjectTree(Content);
     
    115116      projectPermissionsView.Enabled = enabled;
    116117      projectResourcesView.Enabled = enabled;
     118      projectJobsView.Enabled = enabled;
    117119    }
    118120    #endregion
     
    228230        MessageBox.Show(
    229231          "Only empty projects can be deleted.",
     232          "HeuristicLab Hive Administrator",
     233          MessageBoxButtons.OK,
     234          MessageBoxIcon.Error);
     235        return;
     236      }
     237
     238      if (HiveAdminClient.Instance.Jobs.ContainsKey(selectedProject.Id)
     239        && HiveAdminClient.Instance.Jobs[selectedProject.Id] != null
     240        && HiveAdminClient.Instance.Jobs[selectedProject.Id].Any()) {
     241        MessageBox.Show(
     242          "There are " + HiveAdminClient.Instance.Jobs[selectedProject.Id].Count + " jobs using this project and/or child-projects. It is necessary to delete them before the project.",
    230243          "HeuristicLab Hive Administrator",
    231244          MessageBoxButtons.OK,
     
    442455      projectPermissionsView.Content = project;
    443456      projectResourcesView.Content = project;
     457      projectJobsView.Content = project;
    444458
    445459      bool projectIsNew = project != null && project.Id == Guid.Empty;
     
    454468      projectPermissionsView.Locked = locked;
    455469      projectResourcesView.Locked = locked;
     470      projectJobsView.Locked = locked;
    456471      selectedProject = project;
    457472    }
Note: See TracChangeset for help on using the changeset viewer.