Example #1
0
        public override void InvalidateModuleObjects(int iObjectID)
        {
            HRArrangementShiftEntrysController     objArrangementShiftEntrysController    = new HRArrangementShiftEntrysController();
            HREmployeeArrangementShiftsController  objEmployeeArrangementShiftsController = new HREmployeeArrangementShiftsController();
            List <HREmployeeArrangementShiftsInfo> employeeArrangementShiftsList          = objEmployeeArrangementShiftsController.GetEmployeeArrangementShiftByArrangementShiftIDAndUserGroup(iObjectID, VinaApp.CurrentUserInfo.FK_ADUserGroupID);

            EmployeeArrangementShiftsList.Invalidate(employeeArrangementShiftsList);
            foreach (HREmployeeArrangementShiftsInfo employeeArrangementShift in EmployeeArrangementShiftsList)
            {
                employeeArrangementShift.HRArrangementShiftEntrysList = objArrangementShiftEntrysController.GetArrangementShiftEntrysByArrangementShiftIDAndEmployeeArrangementShiftID(
                    employeeArrangementShift.FK_HRArrangementShiftID,
                    employeeArrangementShift.HREmployeeArrangementShiftID);

                SetEmployeeArrangementShiftValue(employeeArrangementShift);
            }
        }
Example #2
0
        public override void SaveModuleObjects()
        {
            HRArrangementShiftsInfo arrangementShift = (HRArrangementShiftsInfo)MainObject;

            //Save employee time sheet list
            EmployeeArrangementShiftsList.SaveItemObjects();
            //Create entry for time sheet
            HRArrangementShiftEntrysController objArrangementShiftEntrysController = new HRArrangementShiftEntrysController();

            foreach (HREmployeeArrangementShiftsInfo objEmployeeArrangementShiftsInfo in EmployeeArrangementShiftsList)
            {
                objArrangementShiftEntrysController.DeleteByForeignColumn("FK_HREmployeeArrangementShiftID", objEmployeeArrangementShiftsInfo.HREmployeeArrangementShiftID);
                foreach (HRArrangementShiftEntrysInfo entry in objEmployeeArrangementShiftsInfo.HRArrangementShiftEntrysList)
                {
                    if (entry.FK_ADWorkingShiftID == 0)
                    {
                        continue;
                    }
                    entry.FK_HRArrangementShiftID         = arrangementShift.HRArrangementShiftID;
                    entry.FK_HREmployeeArrangementShiftID = objEmployeeArrangementShiftsInfo.HREmployeeArrangementShiftID;
                    objArrangementShiftEntrysController.CreateObject(entry);
                }
            }
        }