Example #1
0
        private void HolidaysButtonClick(object sender, EventArgs e)
        {
            var holidaysForm = new HolidaysForm(m_holidays, null);
            holidaysForm.ShowDialog();
            m_holidays = holidaysForm.Holidays;

            m_config.Holidays = m_holidays;
            s_freeDaysCalculator.SetHolidays(m_holidays);
            UpdateHolidays();
        }
Example #2
0
 private void VacationsButtonClick(object sender, EventArgs e)
 {
     string user = workersComboBox.Text;
     var userVacations = m_config.Vacations.FirstOrDefault(v => v.User == user);
     var holidaysForm = new HolidaysForm(userVacations != null ? userVacations.VacationDays : new List<DateTime>(), user);
     holidaysForm.ShowDialog();
     if (userVacations != null)
         m_config.Vacations.Remove(userVacations);
     if (holidaysForm.Holidays.Count > 0)
         m_config.Vacations.Add(new VacationData { User = user, VacationDays = holidaysForm.Holidays });
     s_freeDaysCalculator.SetVacations(m_config.Vacations);
 }