private void NewHoliday() { Absence absence = ClientEnvironment.AbsenceService.CreateEntity(); if (Country != null) { absence.CountryID = Country.ID; } absence.AbsenceTypeID = AbsenceType.Holiday; AbsenceForm form = new AbsenceForm(absence); form.AbsenceManager = _absencemanager; form.CountryReadOnly = Country != null; if (form.ShowDialog() == DialogResult.OK) { if (_bindingAbsences.GetItemByID(absence.ID) == null) { _bindingAbsences.Add(absence); } } }
private void EditIllness() { Absence absence = FocusedEntity; if (absence != null && absence.AbsenceTypeID == AbsenceType.Illness) { AbsenceForm form = new AbsenceForm(absence); form.AbsenceManager = _absencemanager; form.CountryReadOnly = true; if (CheckUsedAbsence(FocusedEntity)) { form.EntityUsed = true; } if (form.ShowDialog() == DialogResult.OK) { if (_bindingAbsences.GetItemByID(form.Absence.ID) != null) { _bindingAbsences.SetEntity(form.Absence); } } } }
private void NewIllness() { if (Country == null) { return; } Absence absence = ClientEnvironment.AbsenceService.CreateEntity(); absence.CountryID = Country.ID; absence.AbsenceTypeID = AbsenceType.Illness; AbsenceForm form = new AbsenceForm(absence); form.AbsenceManager = _absencemanager; form.CountryReadOnly = true; if (form.ShowDialog() == DialogResult.OK) { if (_bindingAbsences.GetItemByID(absence.ID) == null) { _bindingAbsences.Add(absence); } } }
private void NewIllness() { if (Country == null) return; Absence absence = ClientEnvironment.AbsenceService.CreateEntity(); absence.CountryID = Country.ID; absence.AbsenceTypeID = AbsenceType.Illness; AbsenceForm form = new AbsenceForm(absence); form.AbsenceManager = _absencemanager; form.CountryReadOnly = true; if (form.ShowDialog() == DialogResult.OK) { if (_bindingAbsences.GetItemByID(absence.ID) == null) { _bindingAbsences.Add(absence); } } }
private void NewAbsence() { Absence absence = ClientEnvironment.AbsenceService.CreateEntity(); if (Country != null) absence.CountryID = Country.ID; //new Domain.Absence(); absence.AbsenceTypeID = AbsenceType.Absence ; AbsenceForm form = new AbsenceForm(absence); form.AbsenceManager = _absencemanager; form.CountryReadOnly = Country != null; if (form.ShowDialog() == DialogResult.OK) { if (_bindingAbsences.GetItemByID(form.Absence.ID) == null) { _bindingAbsences.Add(form.Absence); } } }