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; } }
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); } }
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(); } }
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; } }
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; } }
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); }
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; }
public JobPosition GetBy(JobPositionId jobPositionId) { return(jobPositionRep.GetById(jobPositionId)); }
public JobPosition GetById(JobPositionId jobPositionId) { return(rep.FindByKey(jobPositionId)); }
public List <JobPosition> GetAllJobPositionByParentId(JobPositionId jobPositionId) { return(jobPositionRep.GetAllJobPositionByParentId(jobPositionId)); }
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()); } }
public List <JobPosition> GetAllJobPositionByParentId(JobPositionId jobPositionId) { return(rep.Find(j => j.Parent.Id == jobPositionId).ToList()); }
public JobPosition GetBy(JobPositionId jobPositionId) { return(rep.Single(u => u.Id.PeriodId == jobPositionId.PeriodId && u.Id.SharedJobPositionId == jobPositionId.SharedJobPositionId)); }