private void btSaveRecurrence_Click(object sender, EventArgs e) { DateTime dateFrom, dateTo; HashSet <DayOfWeek> days = new HashSet <DayOfWeek>(); days = GetDays(); //check if valid if (InputIsValid()) { dateFrom = DateTime.Parse(dtpStart.Text + " " + dtpFromTime.Text); dateTo = DateTime.Parse(dtpEnd.Text + " " + dtpToTime.Text); RecurrentEvent recurrentEvent = new RecurrentEvent() { DateFrom = dateFrom, DateTo = dateTo, AllDay = chbade.Checked, WeekDays = days, DowntimeType = appointmentTypeView.DowntimeType }; //fire delegate and close the dialog dialogClosedDelegate(recurrentEvent); this.Close(); } else { MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btSaveRecurrence_Click(object sender, EventArgs e) { DateTime dateFrom, dateTo; HashSet<DayOfWeek> days = new HashSet<DayOfWeek>(); days = GetDays(); //check if valid if (InputIsValid()) { dateFrom = DateTime.Parse(dtpStart.Text + " " + dtpFromTime.Text); dateTo = DateTime.Parse(dtpEnd.Text + " " + dtpToTime.Text); RecurrentEvent recurrentEvent = new RecurrentEvent() { DateFrom = dateFrom, DateTo = dateTo, AllDay = chbade.Checked, WeekDays = days, DowntimeType = appointmentTypeView.DowntimeType }; //fire delegate and close the dialog dialogClosedDelegate(recurrentEvent); this.Close(); } else { MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void DialogClosed(RecurrentEvent e) { CreateDailyRecurrenceDowntimes(e.DateFrom, e.DateTo, e.AllDay, e.WeekDays, e.DowntimeType); }