public void SettingsChanges(DateTime dtpStartXmas, DateTime dtpEndXmas, DateTime dtpStartSummer, DateTime dtpSummerEnd, NumericUpDown numDaysEnt, NumericUpDown numRelaxed, NumericUpDown numStaffReq, ComboBox cmbxMonths) { peaktime Xpeak = getXmasPeakT(); peaktime Speak = getSummerPeakT(); constraint constraints = getConstraints(); if (MessageBox.Show("Save changes", "Please Confirm Your Action", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Xpeak.StartDate = dtpStartXmas; Xpeak.EndDate = dtpEndXmas; Speak.StartDate = dtpStartSummer; Speak.EndDate = dtpSummerEnd; constraints.HolidayEntitlement = (int)numDaysEnt.Value; constraints.MinimumWorkingStaffRelaxed = (int)numRelaxed.Value; constraints.MinimumWorkingStaff = (int)numStaffReq.Value; constraints.RelaxedMonth = cmbxMonths.SelectedIndex; db.SubmitChanges(); } }
private void HolidaySettingPanel() { var months = System.Globalization.DateTimeFormatInfo.InvariantInfo.MonthNames; cmbxMonths.DataSource = months; constraint constraints = hm.getConstraints(); cmbBXRoles.DataSource = SplitList(constraints.AvailableRoles); cmbBXDepartment.DataSource = SplitList(constraints.AvailableDepartments); numDaysEnt.Value = (decimal)constraints.HolidayEntitlement; numRelaxed.Value = (decimal)constraints.MinimumWorkingStaffRelaxed; numStaffReq.Value = (decimal)constraints.MinimumWorkingStaff; cmbxMonths.SelectedIndex = (int)constraints.RelaxedMonth; peaktime Xpeak = hm.getXmasPeakT(); peaktime Speak = hm.getSummerPeakT(); dtpStartXmas.Value = Xpeak.StartDate; dtpEndXmas.Value = Xpeak.EndDate; dtpStartSummer.Value = Speak.StartDate; dtpSummerEnd.Value = Speak.EndDate; }