Esempio n. 1
0
        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);
                }
            }
        }
Esempio n. 2
0
        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);
                    }
                }
            }
        }
Esempio n. 3
0
        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);
                }
            }
        }
Esempio n. 4
0
        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);
                    }
                }
            }
        }
Esempio n. 5
0
        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);
                }
            }
        }
Esempio n. 6
0
        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);
                }
            }

        }