public void BeforeCreate(List <FonacotMovement> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <FonacotMovement>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 2
0
        public void BeforeCreate(List <IMSSFare> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <IMSSFare>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
        public void BeforeCreate(List <AnualEmploymentSubsidy> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <AnualEmploymentSubsidy>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 4
0
        public void BeforeUpdate(List <IMSSEmployeeTable> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <IMSSEmployeeTable>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
        public void BeforeUpdate(List <EmployerFiscalInformation> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <EmployerFiscalInformation>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 6
0
        public void BeforeUpdate(List <WorkCenter> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <WorkCenter>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 7
0
        private void Validations(List <Inhability> lstObjectsToValidate)
        {
            if (lstObjectsToValidate.Any())
            {
                //all good
                var validator = new RuleValidator <Inhability>();
                validator.ValidateRules(lstObjectsToValidate, createRules);

                Guid identityWork     = lstObjectsToValidate.FirstOrDefault().CompanyID;
                Guid instanceID       = lstObjectsToValidate.FirstOrDefault().InstanceID;
                Guid employeeID       = lstObjectsToValidate.FirstOrDefault().EmployeeID;
                var  lstDates         = lstObjectsToValidate.Select(p => p.InitialDate).ToList();
                var  incidentTypesIds = lstObjectsToValidate.Select(p => p.IncidentTypeID).ToList();

                //Incidents
                ValidateIncidents(identityWork, instanceID, employeeID, lstObjectsToValidate).Wait();

                //Incident Types
                ValidateIncidentType(identityWork, instanceID, employeeID, incidentTypesIds).Wait();

                //Incidents
                ValidateInitialDate(identityWork, instanceID, employeeID, lstDates).Wait();

                ValidateInhabilitiesOnDate(identityWork, instanceID, employeeID, lstObjectsToValidate).Wait();

                //Vacations
                ValidateInDate(lstObjectsToValidate);
            }
        }
Esempio n. 8
0
        public void BeforeUpdate(List <JobPosition> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <JobPosition>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
        public void BeforeUpdate(List <EmployeeConceptsRelationDetail> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <EmployeeConceptsRelationDetail>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 10
0
        public void BeforeUpdate(List <IncidentTypeRelationship> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <IncidentTypeRelationship>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 11
0
        public void BeforeCreate(List <OverdraftDetail> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <OverdraftDetail>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 12
0
        public void BeforeUpdate(List <Address> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <Address>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
        public void BeforeUpdate(List <ConceptPaymentRelationship> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <ConceptPaymentRelationship>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
        public void BeforeUpdate(List <AccumulatedEmployee> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <AccumulatedEmployee>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
        public void BeforeUpdate(List <Settlement> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <Settlement>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 16
0
        public void BeforeCreate(List <EmployerRegistration> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <EmployerRegistration>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 17
0
        public void BeforeCreate(List <NOMAnswer> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <NOMAnswer>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 18
0
        public void BeforeUpdate(List <MinimunSalary> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <MinimunSalary>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 19
0
        public void BeforeUpdate(List <Employee> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <Employee>();

            validator.ValidateRules(lstObjectsToValidate, createRules);

            var identityWorkId          = lstObjectsToValidate.Select(p => p.company).FirstOrDefault();
            var lstObjectsIdsToValidate = lstObjectsToValidate.Select(p => p.ID);

            //creates
            var employeeManager   = new MiddlewareManager <Employee>(new BaseRecordManager <Employee>(), new EmployeeValidator());
            var employeesPrevious = employeeManager.FindByExpressionAsync(p => lstObjectsIdsToValidate.Contains(p.ID), Guid.Empty).Result;

            ConcurrentBag <Employee> employeeChangedPeriod = new ConcurrentBag <Employee>();

            Parallel.ForEach(lstObjectsToValidate, employeeToUpdate =>
            {
                var previous = employeesPrevious.FirstOrDefault(p => p.ID == employeeToUpdate.ID);

                //Si cambia el periodo o cambia la fecha de ingreso se vuelve a crear su overdraft (delete and create)
                if (previous.PeriodTypeID != employeeToUpdate.PeriodTypeID || previous.EntryDate != employeeToUpdate.EntryDate)
                {
                    employeeChangedPeriod.Add(employeeToUpdate);
                }
            });

            //verify if employee changed period
            if (employeeChangedPeriod.Any())
            {
                new OverdraftManager().UpdateByEmployeesAsync(employeeChangedPeriod.ToList()).Wait();
            }
        }
        public void BeforeCreate(List <NOMEvaluationGuide> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <NOMEvaluationGuide>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 21
0
        public void BeforeUpdate(List <CancelationFiscalDocumentDetail> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <CancelationFiscalDocumentDetail>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
        public void BeforeUpdate(List <AnualIncomeTax> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <AnualIncomeTax>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 23
0
        public void BeforeUpdate(List <Incident> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <Incident>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
            BeforeCreateUpdate(lstObjectsToValidate);
        }
Esempio n. 24
0
        public void BeforeUpdate(List <Vacation> lstObjectsToValidate)
        {
            var validator = new RuleValidator <Vacation>();

            validator.ValidateRules(lstObjectsToValidate, createRules);

            ValidateInDate(lstObjectsToValidate);
        }
Esempio n. 25
0
        public void BeforeCreate(List <EmployeeSalaryIncrease> lstObjectsToValidate)
        {
            ValidateBeforeCreateAndUpdate(lstObjectsToValidate);
            //all good
            var validator = new RuleValidator <EmployeeSalaryIncrease>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 26
0
        public void BeforeUpdate(List <EmployeeSBCAdjustment> lstObjectsToValidate)
        {
            ValidateBeforeCreateAndUpdate(lstObjectsToValidate);
            BeforeDeleteCommon(lstObjectsToValidate.Select(p => p.ID).ToList());
            //all good
            var validator = new RuleValidator <EmployeeSBCAdjustment>();

            validator.ValidateRules(lstObjectsToValidate, createRules);
        }
Esempio n. 27
0
        public void BeforeUpdate(List <ConceptPayment> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <ConceptPayment>();

            validator.ValidateRules(lstObjectsToValidate, createRules);

            //Fix conceptPayments Taxed Issue
            FixTaxedConceptPayments(ref lstObjectsToValidate);
        }
        public void BeforeUpdate(List <InfonavitMovement> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <InfonavitMovement>();

            validator.ValidateRules(lstObjectsToValidate, createRules);

            lstObjectsToValidate.ForEach(p =>
            {
                if (!p.IncludeInsurancePayment_D14)
                {
                    p.EmployeeConceptsRelationInsuranceID = null;
                }
            });
        }
Esempio n. 29
0
        public void BeforeUpdate(List <EmployeeSalaryIncrease> lstObjectsToValidate)
        {
            ValidateBeforeCreateAndUpdate(lstObjectsToValidate);
            BeforeDeleteCommon(lstObjectsToValidate.Select(p => p.ID).ToList());
            //all good
            var validator = new RuleValidator <EmployeeSalaryIncrease>();

            validator.ValidateRules(lstObjectsToValidate, createRules);

            var sbcAdjustments = lstObjectsToValidate.Select(x => x.EmployeeSBCAdjustment);
            var identityWorkID = lstObjectsToValidate.FirstOrDefault().CompanyID;

            _middlewareManagerSBCAdjustment.UpdateAsync(sbcAdjustments.ToList(), identityWorkID).Wait();

            lstObjectsToValidate.ForEach(item => item.EmployeeSBCAdjustment = null);
        }
        public void BeforeCreate(List <InfonavitMovement> lstObjectsToValidate)
        {
            //all good
            var validator = new RuleValidator <InfonavitMovement>();

            validator.ValidateRules(lstObjectsToValidate, createRules);

            var employeesIDs = lstObjectsToValidate.Select(x => x.EmployeeID).ToList();

            var middlewareManager = new MiddlewareManager <InfonavitMovement>(new BaseRecordManager <InfonavitMovement>(), this);

            var entities = middlewareManager.FindByExpression(p => employeesIDs.Contains(p.EmployeeID) && p.Active, Guid.Empty, new string[] { });

            if (entities.Any())
            {
                throw new CotorraException(801, "801", "Ya se ha registrado un crédito infonavit activo para el empleado", null);
            }
        }