Пример #1
0
        private void InvalidateArrangementShiftValues()
        {
            ArrangementShiftEntities entity = (ArrangementShiftEntities)CurrentModuleEntity;

            foreach (HREmployeeArrangementShiftsInfo employeeArrangementShift in entity.EmployeeArrangementShiftsList)
            {
                entity.SetEmployeeArrangementShiftValue(employeeArrangementShift);
            }
        }
Пример #2
0
        public void UpdateEmployeeArrangementShift()
        {
            ArrangementShiftEntities entity = (ArrangementShiftEntities)CurrentModuleEntity;
            HRArrangementShiftsInfo  objArrangementShiftsInfo = (HRArrangementShiftsInfo)entity.MainObject;
            HREmployeesController    objEmployeesController   = new HREmployeesController();
            HREmployeesInfo          objEmployeesInfo;

            entity.EmployeeArrangementShiftsList.ForEach(o =>
            {
                objEmployeesInfo = (HREmployeesInfo)objEmployeesController.GetObjectByID(o.FK_HREmployeeID);
                if (objEmployeesInfo != null)
                {
                    AddDefaulArrangementShiftEntries(o, objEmployeesInfo);
                    List <HRArrangementShiftEntrysInfo> arrangementShiftEntrys = o.HRArrangementShiftEntrysList.Where(i => i.FK_HREmployeeID == o.FK_HREmployeeID).ToList();
                    o.HRArrangementShiftEntrysList = arrangementShiftEntrys;
                    entity.SetEmployeeArrangementShiftValue(o);
                }
            });
            entity.EmployeeArrangementShiftsList.GridControl.RefreshDataSource();
        }
Пример #3
0
        public void AddEmployee()
        {
            ArrangementShiftEntities entity = (ArrangementShiftEntities)CurrentModuleEntity;

            List <HREmployeesInfo> employeesList = entity.EmployeesList.Where(o1 => entity.EmployeeArrangementShiftsList.FirstOrDefault(o2 => o2.FK_HREmployeeID == o1.HREmployeeID) == null).ToList();

            guiSearchEmployee guiSearchEmployee = new guiSearchEmployee(employeesList);

            guiSearchEmployee.Module = this;
            if (guiSearchEmployee.ShowDialog() == DialogResult.OK)
            {
                List <HREmployeesInfo> result = (List <HREmployeesInfo>)guiSearchEmployee.SelectedObjects;
                foreach (HREmployeesInfo objEmployeesInfo in result)
                {
                    HREmployeeArrangementShiftsInfo objEmployeeArrangementShiftsInfo = SetEmployeeArrangementShiftsInfoFromEmployee(objEmployeesInfo);
                    AddDefaulArrangementShiftEntries(objEmployeeArrangementShiftsInfo, objEmployeesInfo);
                    List <HRArrangementShiftEntrysInfo> arrangementShiftEntrys = objEmployeeArrangementShiftsInfo.HRArrangementShiftEntrysList.Where(o => o.FK_HREmployeeID == objEmployeeArrangementShiftsInfo.FK_HREmployeeID).ToList();
                    objEmployeeArrangementShiftsInfo.HRArrangementShiftEntrysList = arrangementShiftEntrys;
                    entity.SetEmployeeArrangementShiftValue(objEmployeeArrangementShiftsInfo);
                    entity.EmployeeArrangementShiftsList.Add(objEmployeeArrangementShiftsInfo);
                }
                entity.EmployeeArrangementShiftsList.GridControl.RefreshDataSource();
            }
        }