Esempio n. 1
0
        public void UpdateHREmployeeOTByWorkingShift(int workingShiftID)
        {
            OverTimeEntities entity           = (OverTimeEntities)CurrentModuleEntity;
            HROverTimesInfo  objOverTimesInfo = (HROverTimesInfo)entity.MainObject;

            if (!Toolbar.IsNullOrNoneAction())
            {
                if (entity.EmployeeOTsList.Count > 0)
                {
                    entity.EmployeeOTsList.ForEach(o =>
                    {
                        o.FK_ADWorkingShiftID = workingShiftID;
                    });

                    entity.EmployeeOTsList.GridControl.RefreshDataSource();
                }
                objOverTimesInfo.FK_ADWorkingShiftID = workingShiftID;
                entity.UpdateMainObjectBindingSource();
            }
        }
Esempio n. 2
0
        public void UpdateHREmployeeOTByOTFactor()
        {
            OverTimeEntities entity           = (OverTimeEntities)CurrentModuleEntity;
            HROverTimesInfo  objOverTimesInfo = (HROverTimesInfo)entity.MainObject;

            if (!Toolbar.IsNullOrNoneAction() && objOverTimesInfo.HROverTimeFactor >= 0)
            {
                if (entity.EmployeeOTsList.Count > 0)
                {
                    VinaDbUtil dbUtil = new VinaDbUtil();
                    foreach (HREmployeeOTsInfo employeeOT in entity.EmployeeOTsList)
                    {
                        dbUtil.SetPropertyValue(employeeOT, "HREmployeeOTFactor", objOverTimesInfo.HROverTimeFactor);
                    }
                    entity.EmployeeOTsList.GridControl.RefreshDataSource();
                }
            }
            else
            {
                objOverTimesInfo.HROverTimeFactor = entity.EmployeeOTsList.Count > 0 ? entity.EmployeeOTsList[0].HREmployeeOTFactor : 0;
                entity.UpdateMainObjectBindingSource();
            }
        }