Exemplo n.º 1
0
        public void NewExternalEmployee()
        {
            if (EntityStore != null)
            {
                using (FormExternalEmployee formEmployee = new FormExternalEmployee())
                {
                    Domain.Employee newEmployee = ClientEnvironment.EmployeeService.CreateEntity();
                    newEmployee.ContractBegin = DateTime.Today;
                    newEmployee.ContractEnd   = DateTimeSql.SmallDatetimeMax;

                    newEmployee.MainStoreID = EntityStore.ID;

                    formEmployee.Entity = newEmployee;

                    formEmployee.FilterDate = Context.CurrentAsOfDate;

                    if (formEmployee.ShowDialog() == DialogResult.OK)
                    {
                        Context.EmployeeList.Add((Domain.Employee)formEmployee.Entity);
                        bandedGridViewEmployees.RefreshData();
                        FireChangeEmployeeList();
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void EditExternalEmployee()
        {
            if (EntityStore != null && FocusedEntity != null && !FocusedEntity.Import)
            {
                Domain.Employee empl = FocusedEntity;

                using (FormExternalEmployee formEmployee = new FormExternalEmployee())
                {
                    formEmployee.FilterDate = Context.CurrentAsOfDate;
                    formEmployee.Entity     = empl;

                    if (formEmployee.ShowDialog() == DialogResult.OK)
                    {
                        Context.EmployeeList.ResetItemById(empl.ID);
                    }
                }
            }
        }