Exemple #1
0
        public void GetEmployeesList()
        {
            EmployeeWorkScheduleEntities entity = (EmployeeWorkScheduleEntities)CurrentModuleEntity;
            HREmployeesController        objEmployeesController = new HREmployeesController();

            entity.EmployeesList = objEmployeesController.GetAllEmployees();
        }
Exemple #2
0
        public override void ActionComplete()
        {
            EmployeeWorkScheduleEntities entity = (EmployeeWorkScheduleEntities)CurrentModuleEntity;

            entity.CompleteTransaction();
            InvalidateToolbar();
        }
Exemple #3
0
 public EmployeeWorkScheduleModule()
 {
     CurrentModuleName          = "EmployeeWorkSchedule";
     CurrentModuleEntity        = new EmployeeWorkScheduleEntities();
     CurrentModuleEntity.Module = this;
     InitializeModule();
     GetEmployeesList();
 }
Exemple #4
0
        public override void InitGridControlDataSource()
        {
            EmployeeWorkScheduleEntities entity = (EmployeeWorkScheduleEntities)((BaseModuleERP)Screen.Module).CurrentModuleEntity;
            BindingSource bds = new BindingSource();

            bds.DataSource  = entity.EmployeeWorkScheduleItemsList;
            this.DataSource = bds;
        }
Exemple #5
0
        public override void Invalidate(int iObjectID)
        {
            base.Invalidate(iObjectID);
            EmployeeWorkScheduleEntities entity = (EmployeeWorkScheduleEntities)CurrentModuleEntity;
            HREmployeeWorkSchedulesInfo  obj    = (HREmployeeWorkSchedulesInfo)entity.MainObject;

            obj.HREmployeeWorkScheduleFromDate = obj.HREmployeeWorkScheduleDateFrom;
            obj.HREmployeeWorkScheduleToDate   = obj.HREmployeeWorkScheduleDateTo;
            entity.UpdateMainObjectBindingSource();
        }
Exemple #6
0
        public override int ActionSave()
        {
            EmployeeWorkScheduleEntities entity = (EmployeeWorkScheduleEntities)CurrentModuleEntity;
            HREmployeeWorkSchedulesInfo  obj    = (HREmployeeWorkSchedulesInfo)entity.MainObject;
            DateTime d   = obj.HREmployeeWorkScheduleFromDate;
            DateTime dto = obj.HREmployeeWorkScheduleToDate;

            obj.HREmployeeWorkScheduleDateFrom = new DateTime(d.Year, d.Month, d.Day, obj.HREmployeeWorkScheduleDateFrom.Hour, obj.HREmployeeWorkScheduleDateFrom.Minute, 0);
            obj.HREmployeeWorkScheduleDateTo   = new DateTime(dto.Year, dto.Month, dto.Day, obj.HREmployeeWorkScheduleDateTo.Hour, obj.HREmployeeWorkScheduleDateTo.Minute, 0);
            return(base.ActionSave());
        }
Exemple #7
0
        public override void InvalidateToolbar()
        {
            base.InvalidateToolbar();
            EmployeeWorkScheduleEntities entity     = (EmployeeWorkScheduleEntities)CurrentModuleEntity;
            HREmployeeWorkSchedulesInfo  mainObject = (HREmployeeWorkSchedulesInfo)entity.MainObject;

            ParentScreen.SetEnableOfToolbarButton(BaseToolbar.ToolbarButtonEdit, true);
            if (mainObject.HREmployeeWorkScheduleID > 0)
            {
                if (mainObject.HREmployeeWorkScheduleStatus == EmployeeWorkScheduleStatus.New.ToString())
                {
                    ParentScreen.SetEnableOfToolbarButton(BaseToolbar.ToolbarButtonEdit, true);
                    ParentScreen.SetEnableOfToolbarButton(BaseToolbar.ToolbarButtonComplete, true);
                }
                else
                {
                    ParentScreen.SetEnableOfToolbarButton(BaseToolbar.ToolbarButtonEdit, false);
                    ParentScreen.SetEnableOfToolbarButton(BaseToolbar.ToolbarButtonComplete, false);
                }
            }
        }
Exemple #8
0
        public void AddEmployee()
        {
            EmployeeWorkScheduleEntities entity        = (EmployeeWorkScheduleEntities)CurrentModuleEntity;
            HREmployeeWorkSchedulesInfo  mainObject    = (HREmployeeWorkSchedulesInfo)entity.MainObject;
            List <HREmployeesInfo>       employeesList = entity.EmployeesList.Where(o1 => entity.EmployeeWorkScheduleItemsList.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)
                {
                    HREmployeeWorkScheduleItemsInfo objEmployeeWorkScheduleItemsInfo = new HREmployeeWorkScheduleItemsInfo();
                    entity.SetDefaultValuesFromEmployee(objEmployeeWorkScheduleItemsInfo, objEmployeesInfo);
                    entity.EmployeeWorkScheduleItemsList.Add(objEmployeeWorkScheduleItemsInfo);
                }
                entity.EmployeeWorkScheduleItemsList.GridControl.RefreshDataSource();

                mainObject.HREmployeeCardNumber = string.Join(";", entity.EmployeeWorkScheduleItemsList.Select(o1 => o1.HREmployeeCardNumber).ToArray());
                mainObject.HREmployeeName       = string.Join(";", entity.EmployeeWorkScheduleItemsList.Select(o1 => o1.HREmployeeName).ToArray());
            }
        }
Exemple #9
0
        public void RemoveSelectedItemFromEmployeeWorkScheduleItemList()
        {
            EmployeeWorkScheduleEntities entity = (EmployeeWorkScheduleEntities)CurrentModuleEntity;

            entity.EmployeeWorkScheduleItemsList.RemoveSelectedRowObjectFromList();
        }