Changeset 6943 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.3/Views/Recurrence.cs
- Timestamp:
- 10/31/11 23:58:52 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.3/Views/Recurrence.cs
r6696 r6943 39 39 40 40 private void btSaveRecurrence_Click(object sender, EventArgs e) { 41 DateTime dateFrom, dateTo; 41 DateTime dateFrom, dateTo; 42 42 HashSet<DayOfWeek> days = new HashSet<DayOfWeek>(); 43 43 … … 45 45 46 46 //check if valid 47 if (InputIsValid()) 48 { 49 dateFrom = DateTime.Parse(dtpStart.Text + " " + dtpFromTime.Text); 50 dateTo = DateTime.Parse(dtpEnd.Text + " " + dtpToTime.Text); 47 if (InputIsValid()) { 48 dateFrom = DateTime.Parse(dtpStart.Text + " " + dtpFromTime.Text); 49 dateTo = DateTime.Parse(dtpEnd.Text + " " + dtpToTime.Text); 51 50 52 RecurrentEvent recurrentEvent = new RecurrentEvent() 53 { 54 DateFrom = dateFrom, 55 DateTo = dateTo, 56 AllDay = chbade.Checked, 57 WeekDays = days 58 }; 51 RecurrentEvent recurrentEvent = new RecurrentEvent() { 52 DateFrom = dateFrom, 53 DateTo = dateTo, 54 AllDay = chbade.Checked, 55 WeekDays = days 56 }; 59 57 60 //fire delegate and close the dialog 61 dialogClosedDelegate(recurrentEvent); 62 this.Close(); 63 } 64 else 65 { 66 MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 58 //fire delegate and close the dialog 59 dialogClosedDelegate(recurrentEvent); 60 this.Close(); 61 } else { 62 MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 67 63 } 68 64 } … … 90 86 91 87 private bool InputIsValid() { 92 DateTime dateFrom, dateTo; 88 DateTime dateFrom, dateTo; 93 89 94 90 dateFrom = DateTime.Parse(dtpStart.Text + " " + dtpFromTime.Text); 95 91 dateTo = DateTime.Parse(dtpEnd.Text + " " + dtpToTime.Text); 96 92 97 if ( dateFrom < dateTo && dateFrom.TimeOfDay < dateTo.TimeOfDay)93 if (chbade.Checked && dateFrom < dateTo) { 98 94 return true; 99 else 100 return false; 95 } 96 97 if (!chbade.Checked && dateFrom < dateTo && dateFrom.TimeOfDay < dateTo.TimeOfDay) { 98 return true; 99 } 100 101 return false; 101 102 } 102 103 }
Note: See TracChangeset
for help on using the changeset viewer.