예제 #1
0
        public void EnterLongTimeAbsence()
        {
            if (EntityStore != null && FocusedEntity != null)
            {
                EmployeeLongTimeAbsence newAbsence = ClientEnvironment.EmployeeLongTimeAbsenceService.CreateEntity();
                long focusedEmployeeID             = FocusedEntity.ID;
                newAbsence.EmployeeID       = focusedEmployeeID;
                newAbsence.EmployeeFullName = FocusedEntity.FullName;

                Context.EmployeeAbsence = newAbsence;

                using (FormEmployeeLongTimeAbsence form = new FormEmployeeLongTimeAbsence())
                {
                    form.Entity = Context;

                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        Context.EmployeeList.ResetItemById(focusedEmployeeID);
                    }
                }

                /*
                 * using (Baumax.ClientUI.FormEntities.TimePlanning.AbsencePlanning.FormEmployeeLongTime form = new Baumax.ClientUI.FormEntities.TimePlanning.AbsencePlanning.FormEmployeeLongTime())
                 * {
                 *  form.Bind(Context.EmployeeList, ClientEnvironment.LongTimeAbsenceService.FindAllByCountry(Context.CurrentCountryID), true);
                 *  form.Entity = newAbsence;
                 *  if (form.ShowDialog() == DialogResult.OK)
                 *      Context.EmployeeList.ResetItemById(focusedEmployeeID);
                 * }*/
            }
        }
예제 #2
0
        public void FireEditEntity()
        {
            if (Context != null && FocusedEntity != null && EditEnabled)
            {
                Context.EmployeeAbsence = FocusedEntity;
                using (Employee.FormEmployeeLongTimeAbsence form = new Employee.FormEmployeeLongTimeAbsence())
                {
                    form.Entity = Context;

                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        EmployeesLongTimeAbsence.ResetItemById(Context.EmployeeAbsence.ID);
                        Context.EmployeeList.ResetItemById(Context.EmployeeAbsence.EmployeeID);
                    }
                }
            }
        }
예제 #3
0
        public void FireNewEntity()
        {
            if (Context != null)
            {
                Context.EmployeeAbsence = new EmployeeLongTimeAbsence();
                using (FormEmployeeLongTimeAbsence form = new FormEmployeeLongTimeAbsence())
                {
                    form.Entity = Context;

                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        EmployeesLongTimeAbsence.Add(Context.EmployeeAbsence);
                        Context.EmployeeList.ResetItemById(Context.EmployeeAbsence.EmployeeID);
                    }
                }
            }
        }
예제 #4
0
        public void FireEditEntity()
        {
            if (Context != null && FocusedEntity != null && EditEnabled)
            {
                Context.EmployeeAbsence = FocusedEntity;
                using (Employee.FormEmployeeLongTimeAbsence form = new Employee.FormEmployeeLongTimeAbsence())
                {
                    form.Entity = Context;

                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        EmployeesLongTimeAbsence.ResetItemById(Context.EmployeeAbsence.ID);
                        Context.EmployeeList.ResetItemById(Context.EmployeeAbsence.EmployeeID);
                    }
                }
            }
        }