예제 #1
0
        public EmployeeJobPosition(Employee employee, JobPosition jobPosition, DateTime fromDate, DateTime toDate, int workTimePercent, int jobPositionWeight, List <EmployeeJobCustomFieldValue> employeeJobCustomFieldValues)
        {
            if (jobPosition == null)
            {
                throw new ArgumentNullException("jobPosition");
            }
            if (jobPosition.Id == null)
            {
                throw new ArgumentNullException("jobPosition.Id");
            }
            if (employee == null)
            {
                throw new ArgumentNullException("employee");
            }

            jobPositionId          = jobPosition.Id;
            this.workTimePercent   = workTimePercent;
            this.jobPositionWeight = jobPositionWeight;
            this.fromDate          = fromDate;
            this.toDate            = toDate.Date;
            this.employee          = employee;
            employeeNo             = employee.Id.EmployeeNo;
            if (employeeJobCustomFieldValues != null)
            {
                this.employeeJobCustomFieldValues = employeeJobCustomFieldValues;
            }
        }
예제 #2
0
 public JobPosition ConfigureInquiry(JobPositionId jobPositionId, bool forceConfigure = false)
 {
     using (var tr = new TransactionScope())
     {
         var jobPosition = jobPositionRep.GetBy(jobPositionId);
         jobPosition.ConfigeInquirer(configuratorService, forceConfigure);
         tr.Complete();
         return(jobPosition);
     }
 }
예제 #3
0
        public void UpdateInquirers(EmployeeId inquirySubjectEmployeeId, JobPositionId jobPositionId, List <EmployeeIdWithJobPositionId> inquirerEmployeeIdList)
        {
            using (var tr = new TransactionScope())
            {
                var jobPosition    = jobPositionRep.GetBy(jobPositionId);
                var inquirySubject = employeeRepository.GetBy(inquirySubjectEmployeeId);

                //var inquirers = employeeRepository.FindInList(inquirerEmployeeIdList.Select(i => i.EmployeeNo).ToList(),
                //    jobPositionId.PeriodId);

                jobPosition.UpdateInquirersBy(inquirySubject, inquirerEmployeeIdList, periodChecker);

                tr.Complete();
            }
        }
예제 #4
0
 public void Delete(JobPositionId jobPositionId)
 {
     try
     {
         using (var scope = new TransactionScope())
         {
             var jobPostion = jobPositionRep.GetById(jobPositionId);
             jobPositionRep.Delete(jobPostion);
             scope.Complete();
         }
     }
     catch (Exception exp)
     {
         var res = jobPositionRep.TryConvertException(exp);
         if (res == null)
         {
             throw;
         }
         throw res;
     }
 }
예제 #5
0
 public JobPosition UppdateJobPosition(JobPositionId jobPositionId, string name, string dictionaryName)
 {
     try
     {
         using (var scope = new TransactionScope())
         {
             var jobPosition = jobPositionRep.GetById(jobPositionId);
             jobPosition.Update(name, dictionaryName);
             scope.Complete();
             return(jobPosition);
         }
     }
     catch (Exception exp)
     {
         var res = jobPositionRep.TryConvertException(exp);
         if (res == null)
         {
             throw;
         }
         throw res;
     }
 }
예제 #6
0
        private void copyJobPosition(Period currentPeriod, JobPositionId sourceJobPositionId, SharedJobPositionId parentId)
        {
            var childs = new List<JobPosition>();
            var serviceManager = jobPositionServiceFactory.Create();
            JobPosition sourceJobPosition;
            try
            {
                var jobPositionService = serviceManager.GetService();
                sourceJobPosition = jobPositionService.GetBy(sourceJobPositionId);
                var newUnitId = getUnitIdForCopy(currentPeriod, sourceJobPosition.UnitId);
                var newJobId = getJobIdForCopy(currentPeriod, sourceJobPosition.JobId);
                jobPositionService.AssignJobPosition(currentPeriod.Id, sourceJobPosition.SharedJobPosition.Id, parentId, newJobId, newUnitId);
                childs = jobPositionService.GetAllJobPositionByParentId(sourceJobPosition.Id);
            }
            finally
            {
                jobPositionServiceFactory.Release(serviceManager);
            }

            foreach (JobPosition u in childs)
                copyJobPosition(currentPeriod, u.Id, sourceJobPosition.SharedJobPosition.Id);

        }
예제 #7
0
 public JobPositionPoint(CalculationPointId id, Period period, Employee employee,
                         Calculation calculation, JobPosition jobPosition, string name, decimal value, bool isFinal = false)
     : base(id, period, employee, calculation, name, value, isFinal)
 {
     this.jobPositionId = jobPosition.Id;
 }
예제 #8
0
 public JobPosition GetBy(JobPositionId jobPositionId)
 {
     return(jobPositionRep.GetById(jobPositionId));
 }
예제 #9
0
 public JobPosition GetById(JobPositionId jobPositionId)
 {
     return(rep.FindByKey(jobPositionId));
 }
예제 #10
0
 public List <JobPosition> GetAllJobPositionByParentId(JobPositionId jobPositionId)
 {
     return(jobPositionRep.GetAllJobPositionByParentId(jobPositionId));
 }
예제 #11
0
 public List <JobPositionInquiryConfigurationItem> GetInquirySubjectWithInquirer(JobPositionId jobPositionId)
 {
     using (var tr = new TransactionScope())
     {
         var jobPosition = jobPositionRep.GetBy(jobPositionId);
         jobPosition.ConfigeInquirer(configuratorService, false);
         tr.Complete();
         return(jobPosition.ConfigurationItemList.ToList());
     }
 }
예제 #12
0
 public List <JobPosition> GetAllJobPositionByParentId(JobPositionId jobPositionId)
 {
     return(rep.Find(j => j.Parent.Id == jobPositionId).ToList());
 }
예제 #13
0
 public JobPosition GetBy(JobPositionId jobPositionId)
 {
     return(rep.Single(u => u.Id.PeriodId == jobPositionId.PeriodId && u.Id.SharedJobPositionId == jobPositionId.SharedJobPositionId));
 }