Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/08/18 15:34:12 (6 years ago)
Author:
jzenisek
Message:

#2839:

  • fixed project/resource selector in HiveJobManager
  • added error provider to project/resource selector
  • changed datetime pickers in HiveAdmin...
Location:
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views
Files:
4 edited

Legend:

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

    r14185 r15956  
    4848      this.chbade = new System.Windows.Forms.CheckBox();
    4949      this.dtpEnd = new System.Windows.Forms.DateTimePicker();
    50       this.dtpToTime = new System.Windows.Forms.DateTimePicker();
    5150      this.label5 = new System.Windows.Forms.Label();
    5251      this.dtpStart = new System.Windows.Forms.DateTimePicker();
    53       this.dtpFromTime = new System.Windows.Forms.DateTimePicker();
    5452      this.label6 = new System.Windows.Forms.Label();
    5553      this.btSaveRecurrence = new System.Windows.Forms.Button();
     
    7472      this.gbAppointment.Controls.Add(this.chbade);
    7573      this.gbAppointment.Controls.Add(this.dtpEnd);
    76       this.gbAppointment.Controls.Add(this.dtpToTime);
    7774      this.gbAppointment.Controls.Add(this.label5);
    7875      this.gbAppointment.Controls.Add(this.dtpStart);
    79       this.gbAppointment.Controls.Add(this.dtpFromTime);
    8076      this.gbAppointment.Controls.Add(this.label6);
    8177      this.gbAppointment.Location = new System.Drawing.Point(2, 2);
     
    9894      // dtpEnd
    9995      //
    100       this.dtpEnd.Format = System.Windows.Forms.DateTimePickerFormat.Short;
     96      this.dtpEnd.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
     97      this.dtpEnd.CustomFormat = "ddd, dd.MM.yyyy, HH:mm:ss";
    10198      this.dtpEnd.Location = new System.Drawing.Point(113, 56);
    10299      this.dtpEnd.Name = "dtpEnd";
    103       this.dtpEnd.Size = new System.Drawing.Size(91, 20);
     100      this.dtpEnd.Size = new System.Drawing.Size(175, 20);
    104101      this.dtpEnd.TabIndex = 29;
    105       //
    106       // dtpToTime
    107       //
    108       this.dtpToTime.CustomFormat = "HH:mm";
    109       this.dtpToTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
    110       this.dtpToTime.Location = new System.Drawing.Point(226, 56);
    111       this.dtpToTime.Name = "dtpToTime";
    112       this.dtpToTime.ShowUpDown = true;
    113       this.dtpToTime.Size = new System.Drawing.Size(73, 20);
    114       this.dtpToTime.TabIndex = 38;
    115102      //
    116103      // label5
     
    126113      //
    127114      this.dtpStart.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
     115      this.dtpStart.CustomFormat = "ddd, dd.MM.yyyy, HH:mm:ss";
    128116      this.dtpStart.Location = new System.Drawing.Point(113, 19);
    129117      this.dtpStart.Name = "dtpStart";
    130       this.dtpStart.Size = new System.Drawing.Size(89, 20);
     118      this.dtpStart.Size = new System.Drawing.Size(175, 20);
    131119      this.dtpStart.TabIndex = 28;
    132       //
    133       // dtpFromTime
    134       //
    135       this.dtpFromTime.CustomFormat = "HH:mm";
    136       this.dtpFromTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
    137       this.dtpFromTime.Location = new System.Drawing.Point(226, 19);
    138       this.dtpFromTime.Name = "dtpFromTime";
    139       this.dtpFromTime.ShowUpDown = true;
    140       this.dtpFromTime.Size = new System.Drawing.Size(73, 20);
    141       this.dtpFromTime.TabIndex = 30;
    142120      //
    143121      // label6
     
    307285    private System.Windows.Forms.Button btSaveRecurrence;
    308286    private System.Windows.Forms.Button btCancelRecurrence;
    309     private System.Windows.Forms.DateTimePicker dtpFromTime;
    310     private System.Windows.Forms.DateTimePicker dtpToTime;
    311287    private System.Windows.Forms.CheckBox chbade;
    312288    private System.Windows.Forms.GroupBox gbWeekly;
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/Recurrence.cs

    r14185 r15956  
    4646      //check if valid
    4747      if (InputIsValid()) {
    48         dateFrom = DateTime.Parse(dtpStart.Text + " " + dtpFromTime.Text);
    49         dateTo = DateTime.Parse(dtpEnd.Text + " " + dtpToTime.Text);
     48        dateFrom = DateTime.Parse(dtpStart.Text);
     49        dateTo = DateTime.Parse(dtpEnd.Text);
    5050
    5151        RecurrentEvent recurrentEvent = new RecurrentEvent() {
     
    8989      DateTime dateFrom, dateTo;
    9090
    91       dateFrom = DateTime.Parse(dtpStart.Text + " " + dtpFromTime.Text);
    92       dateTo = DateTime.Parse(dtpEnd.Text + " " + dtpToTime.Text);
     91      dateFrom = DateTime.Parse(dtpStart.Text);
     92      dateTo = DateTime.Parse(dtpEnd.Text);
    9393
    9494      if (chbade.Checked && dateFrom < dateTo) {
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.Designer.cs

    r14185 r15956  
    4848      Calendar.DrawTool drawTool1 = new Calendar.DrawTool();
    4949      this.dvOnline = new Calendar.DayView();
    50       this.txttimeTo = new System.Windows.Forms.DateTimePicker();
    51       this.txttimeFrom = new System.Windows.Forms.DateTimePicker();
    5250      this.dtpTo = new System.Windows.Forms.DateTimePicker();
    5351      this.groupBox1 = new System.Windows.Forms.GroupBox();
     
    9492      this.dvOnline.OnSelectionChanged += new System.EventHandler<System.EventArgs>(this.dvOnline_OnSelectionChanged);
    9593      //
    96       // txttimeTo
    97       //
    98       this.txttimeTo.CustomFormat = "HH:mm";
    99       this.txttimeTo.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
    100       this.txttimeTo.Location = new System.Drawing.Point(164, 45);
    101       this.txttimeTo.Name = "txttimeTo";
    102       this.txttimeTo.ShowUpDown = true;
    103       this.txttimeTo.Size = new System.Drawing.Size(73, 20);
    104       this.txttimeTo.TabIndex = 40;
    105       //
    106       // txttimeFrom
    107       //
    108       this.txttimeFrom.CustomFormat = "HH:mm";
    109       this.txttimeFrom.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
    110       this.txttimeFrom.Location = new System.Drawing.Point(164, 12);
    111       this.txttimeFrom.Name = "txttimeFrom";
    112       this.txttimeFrom.ShowUpDown = true;
    113       this.txttimeFrom.Size = new System.Drawing.Size(73, 20);
    114       this.txttimeFrom.TabIndex = 39;
    115       //
    11694      // dtpTo
    11795      //
    11896      this.dtpTo.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
     97      this.dtpTo.CustomFormat = "ddd, dd.MM.yyyy, HH:mm:ss";
    11998      this.dtpTo.Location = new System.Drawing.Point(72, 45);
    12099      this.dtpTo.Name = "dtpTo";
    121       this.dtpTo.Size = new System.Drawing.Size(89, 20);
     100      this.dtpTo.Size = new System.Drawing.Size(175, 20);
    122101      this.dtpTo.TabIndex = 33;
    123102      //
     
    125104      //
    126105      this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    127       this.groupBox1.Controls.Add(this.txttimeTo);
    128       this.groupBox1.Controls.Add(this.txttimeFrom);
    129106      this.groupBox1.Controls.Add(this.dtpTo);
    130107      this.groupBox1.Controls.Add(this.dtpFrom);
     
    144121      //
    145122      this.dtpFrom.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
     123      this.dtpFrom.CustomFormat = "ddd, dd.MM.yyyy, HH:mm:ss";
    146124      this.dtpFrom.Location = new System.Drawing.Point(72, 12);
    147125      this.dtpFrom.Name = "dtpFrom";
    148       this.dtpFrom.Size = new System.Drawing.Size(89, 20);
     126      this.dtpFrom.Size = new System.Drawing.Size(175, 20);
    149127      this.dtpFrom.TabIndex = 32;
    150128      //
     
    157135      this.chbade.TabIndex = 31;
    158136      this.chbade.Text = "All Day Event";
     137      this.chbade.CheckedChanged += new System.EventHandler(this.chbade_CheckedChanged);
    159138      this.chbade.UseVisualStyleBackColor = true;
    160       this.chbade.CheckedChanged += new System.EventHandler(this.chbade_CheckedChanged);
    161139      //
    162140      // btnRecurrence
     
    273251    #endregion
    274252
    275     private System.Windows.Forms.DateTimePicker txttimeTo;
    276253    private Calendar.DayView dvOnline;
    277     private System.Windows.Forms.DateTimePicker txttimeFrom;
    278254    private System.Windows.Forms.DateTimePicker dtpTo;
    279255    private System.Windows.Forms.GroupBox groupBox1;
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.cs

    r15813 r15956  
    9292
    9393      if (!string.IsNullOrEmpty(dtpFrom.Text) && !string.IsNullOrEmpty(dtpTo.Text)) {
    94         if (chbade.Checked) {
     94        if (DateTime.TryParse(dtpFrom.Text, out from) && DateTime.TryParse(dtpTo.Text, out to) && from <= to) {
    9595          //whole day appointment, only dates are visible
    96           if (DateTime.TryParse(dtpFrom.Text, out from) && DateTime.TryParse(dtpTo.Text, out to) && from <= to)
    97             offlineTimes.Add(CreateDowntime(from, to.AddDays(1), true, dtType));
    98           else
    99             MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    100         } else if (!string.IsNullOrEmpty(txttimeFrom.Text) && !string.IsNullOrEmpty(txttimeTo.Text)) {
    101           //Timeframe appointment
    102           if (DateTime.TryParse(dtpFrom.Text + " " + txttimeFrom.Text, out from) && DateTime.TryParse(dtpTo.Text + " " + txttimeTo.Text, out to) && from < to) {
     96          if (chbade.Checked) {
     97            offlineTimes.Add(CreateDowntime(new DateTime(from.Year, from.Month, from.Day), (new DateTime(to.Year, to.Month, to.Day)).AddDays(1), true, dtType));
     98          } else {
     99            //Timeframe appointment
    103100            if (from.Date == to.Date)
    104101              offlineTimes.Add(CreateDowntime(from, to, false, dtType));
     
    111108              offlineTimes.Add(CreateDowntime(from, new DateTime(from.Year, from.Month, from.Day, to.Hour, to.Minute, 0, 0), false, dtType));
    112109            }
    113           } else
    114             MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    115         }
     110          }
     111
     112        } else {
     113          MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     114        }
     115
     116
    116117        dvOnline.Invalidate();
    117118        return true;
     
    156157
    157158    private void ChangeRecurrenceDowntime(Guid recurringId) {
    158       int hourfrom = int.Parse(txttimeFrom.Text.Substring(0, txttimeFrom.Text.IndexOf(':')));
    159       int hourTo = int.Parse(txttimeTo.Text.Substring(0, txttimeTo.Text.IndexOf(':')));
    160       List<HiveDowntime> recurringDowntimes = offlineTimes.Where(appointment => ((HiveDowntime)appointment).RecurringId == recurringId).ToList();
    161       recurringDowntimes.ForEach(appointment => appointment.StartDate = new DateTime(appointment.StartDate.Year, appointment.StartDate.Month, appointment.StartDate.Day, hourfrom, 0, 0));
    162       recurringDowntimes.ForEach(appointment => appointment.EndDate = new DateTime(appointment.EndDate.Year, appointment.EndDate.Month, appointment.EndDate.Day, hourTo, 0, 0));
     159      DateTime from, to;
     160      if (DateTime.TryParse(dtpFrom.Text, out from) && DateTime.TryParse(dtpTo.Text, out to) && from <= to) {
     161        List<HiveDowntime> recurringDowntimes = offlineTimes.Where(appointment => ((HiveDowntime)appointment).RecurringId == recurringId).ToList();
     162        recurringDowntimes.ForEach(appointment => appointment.StartDate = new DateTime(appointment.StartDate.Year, appointment.StartDate.Month, appointment.StartDate.Day, from.Hour, 0, 0));
     163        recurringDowntimes.ForEach(appointment => appointment.EndDate = new DateTime(appointment.EndDate.Year, appointment.EndDate.Month, appointment.EndDate.Day, to.Hour, 0, 0));
     164      } else {
     165        MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     166      }
    163167    }
    164168
     
    249253
    250254    private void chbade_CheckedChanged(object sender, EventArgs e) {
    251       txttimeFrom.Visible = !chbade.Checked;
    252       txttimeTo.Visible = !chbade.Checked;
     255      if(chbade.Checked) {
     256        dtpFrom.Value = new DateTime(dtpFrom.Value.Year, dtpFrom.Value.Month, dtpFrom.Value.Day);
     257        dtpTo.Value = new DateTime(dtpTo.Value.Year, dtpTo.Value.Month, dtpTo.Value.Day);
     258      }
    253259    }
    254260
    255261    private void dvOnline_OnSelectionChanged(object sender, EventArgs e) {
    256262      if (dvOnline.Selection == SelectionType.DateRange) {
    257         dtpFrom.Text = dvOnline.SelectionStart.ToShortDateString();
    258         dtpTo.Text = dvOnline.SelectionEnd.Date.ToShortDateString();
    259         txttimeFrom.Text = dvOnline.SelectionStart.ToShortTimeString();
    260         txttimeTo.Text = dvOnline.SelectionEnd.ToShortTimeString();
     263        dtpFrom.Value = dvOnline.SelectionStart;
     264        dtpTo.Value = dvOnline.SelectionEnd.Date;
    261265        btCreate.Text = "Create Downtime";
    262266      }
    263267
    264268      if (dvOnline.Selection == SelectionType.Appointment) {
    265         dtpFrom.Text = dvOnline.SelectedAppointment.StartDate.ToShortDateString();
    266         dtpTo.Text = dvOnline.SelectedAppointment.EndDate.ToShortDateString();
    267         txttimeFrom.Text = dvOnline.SelectedAppointment.StartDate.ToShortTimeString();
    268         txttimeTo.Text = dvOnline.SelectedAppointment.EndDate.ToShortTimeString();
     269        dtpFrom.Value = dvOnline.SelectedAppointment.StartDate;
     270        dtpTo.Value = dvOnline.SelectedAppointment.EndDate;
    269271
    270272        if (dvOnline.SelectedAppointment.Recurring)
Note: See TracChangeset for help on using the changeset viewer.