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

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

            entity.CompleteTransaction();
            InvalidateToolbar();
        }
Example #3
0
 public DisciplineModule()
 {
     CurrentModuleName          = "Discipline";
     CurrentModuleEntity        = new DisciplineEntities();
     CurrentModuleEntity.Module = this;
     InitializeModule();
     GetEmployeesList();
 }
Example #4
0
        public void UpdateItemDate()
        {
            DisciplineEntities entity     = (DisciplineEntities)CurrentModuleEntity;
            HRDisciplinesInfo  mainObject = (HRDisciplinesInfo)entity.MainObject;

            entity.EmployeeDisciplinesList.ForEach(o1 => o1.HREmployeeDisciplineDate = mainObject.HRDisciplineFromDate);
            entity.EmployeeDisciplinesList.GridControl.RefreshDataSource();
        }
Example #5
0
        public override void InitGridControlDataSource()
        {
            DisciplineEntities entity = (DisciplineEntities)((BaseModuleERP)Screen.Module).CurrentModuleEntity;
            BindingSource      bds    = new BindingSource();

            bds.DataSource  = entity.EmployeeDisciplinesList;
            this.DataSource = bds;
        }
Example #6
0
        public void UpdateValue()
        {
            decimal            result          = 0;
            DisciplineEntities entity          = (DisciplineEntities)CurrentModuleEntity;
            HRDisciplinesInfo  mainObject      = (HRDisciplinesInfo)entity.MainObject;
            decimal            DisciplineValue = 0;

            decimal.TryParse(mainObject.HRDisciplineValue, out DisciplineValue);
            entity.EmployeeDisciplinesList.ForEach(o1 =>
            {
                o1.HREmployeeDisciplineValue       = mainObject.HRDisciplineValue;
                o1.HREmployeeDisciplineValueAmount = DisciplineValue;
            });
            entity.EmployeeDisciplinesList.GridControl.RefreshDataSource();
        }
Example #7
0
        public void AddEmployee()
        {
            DisciplineEntities entity = (DisciplineEntities)CurrentModuleEntity;

            List <HREmployeesInfo> employeesList = entity.EmployeesList.Where(o1 => entity.EmployeeDisciplinesList.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)
                {
                    HREmployeeDisciplinesInfo objEmployeeDisciplinesInfo = new HREmployeeDisciplinesInfo();
                    entity.SetDefaultValuesFromEmployee(objEmployeeDisciplinesInfo, objEmployeesInfo);
                    entity.EmployeeDisciplinesList.Add(objEmployeeDisciplinesInfo);
                }
                entity.EmployeeDisciplinesList.GridControl.RefreshDataSource();
            }
        }
Example #8
0
        public override void InvalidateToolbar()
        {
            base.InvalidateToolbar();
            DisciplineEntities entity     = (DisciplineEntities)CurrentModuleEntity;
            HRDisciplinesInfo  mainObject = (HRDisciplinesInfo)entity.MainObject;

            ParentScreen.SetEnableOfToolbarButton(BaseToolbar.ToolbarButtonEdit, true);
            if (mainObject.HRDisciplineID > 0)
            {
                if (mainObject.HRDisciplineStatus == DisciplineStatus.New.ToString())
                {
                    ParentScreen.SetEnableOfToolbarButton(BaseToolbar.ToolbarButtonEdit, true);
                    ParentScreen.SetEnableOfToolbarButton(BaseToolbar.ToolbarButtonComplete, true);
                }
                else
                {
                    ParentScreen.SetEnableOfToolbarButton(BaseToolbar.ToolbarButtonEdit, false);
                    ParentScreen.SetEnableOfToolbarButton(BaseToolbar.ToolbarButtonComplete, false);
                }
            }
        }
Example #9
0
        public void RemoveSelectedItemFromDisciplineItemList()
        {
            DisciplineEntities entity = (DisciplineEntities)CurrentModuleEntity;

            entity.EmployeeDisciplinesList.RemoveSelectedRowObjectFromList();
        }
Example #10
0
        public override int ActionSave()
        {
            DisciplineEntities entity = (DisciplineEntities)CurrentModuleEntity;

            return(base.ActionSave());
        }