private void init() { Employee = new EmployeeDTO(); Period = new PeriodDTO(); JobPositionAssignment = new EmployeeJobPositionAssignmentDTO(); DisplayName = EmployeeMgtAppLocalizedResources.EmployeeViewTitle; }
public UpdateEmployeeJobPositionAssignment(EmployeeJobPositionAssignmentDTO employeeJobPositionAssignment, PeriodDTO period, EmployeeDTO employee, ActionType action) { EmployeeJobPositionAssignment = employeeJobPositionAssignment; Period = period; Employee = employee; Action = action; }
public void ShowEmployeeJobCustomFieldsView(EmployeeDTO employee, PeriodDTO period, EmployeeJobPositionAssignmentDTO jobPositionAssignment, ActionType action) { var view = ServiceLocator.Current.GetInstance <IEmployeeJobCustomFieldsView>(); ((EmployeeJobCustomFieldsVM)view.ViewModel).Load(employee, period, jobPositionAssignment, action); viewManager.ShowInDialog(view); }
private void add() { if (SelectedJobPosition == null || EmployeeJobPositions.EmployeeJobPositionAssignmentList.Select(c => c.JobPositionId) .Contains(SelectedJobPosition.Data.JobPositionId)) { return; } var jobPositionAssignment = new EmployeeJobPositionAssignmentDTO() { JobPositionName = SelectedJobPosition.Data.Name, JobPositionId = SelectedJobPosition.Data.JobPositionId, FromDate = Period.StartDate, ToDate = Period.EndDate }; employeeController.ShowEmployeeJobCustomFieldsView(employee, period, jobPositionAssignment, ActionType.AddEmployeeJobCustomFields); }
public void Load(EmployeeDTO employeeParam, PeriodDTO periodParam, EmployeeJobPositionAssignmentDTO jobPositionAssignmentParam, ActionType actionTypeParam) { actionType = actionTypeParam; Employee = employeeParam; Period = periodParam; JobPositionAssignment = jobPositionAssignmentParam; jobPositionInPeriodService.GetJobInPeriodByJobPostionId((res, exp) => appController.BeginInvokeOnDispatcher(() => { if (exp == null) { setEmployeeCustomFields(res.CustomFields); } else { appController.HandleException(exp); } }), period.Id, JobPositionAssignment.JobPositionId); }
private EmployeeJobPositionsDTO mapToEmployeeJobPositionDTO(Employee employee) { //todo:(LOW)Must convert to Mapper var employeeJobPosition = new EmployeeJobPositionsDTO { EmployeeNo = employee.Id.EmployeeNo, PeriodId = employee.Id.PeriodId.Id }; employeeJobPosition.EmployeeJobPositionAssignmentList = new List <EmployeeJobPositionAssignmentDTO>(); foreach (var itm in employee.JobPositions) { var employeeJobPositionAssignmentDTO = new EmployeeJobPositionAssignmentDTO { JobPositionName = converter.GetSharedJobPosition(itm.JobPositionId.SharedJobPositionId).Name, JobPositionId = itm.JobPositionId.SharedJobPositionId.Id, FromDate = itm.FromDate, ToDate = itm.ToDate, WorkTimePercent = itm.WorkTimePercent, JobPositionWeight = itm.JobPositionWeight, ActionCodes = new List <int> { (int)ActionType.ModifyEmployeeJobCustomFields, } }; employeeJobPositionAssignmentDTO.CustomFieldValueList = new List <CustomFieldValueDTO>(); foreach (var employeeJobCustomFieldValue in itm.EmployeeJobCustomFieldValues) { employeeJobPositionAssignmentDTO.CustomFieldValueList.Add(new CustomFieldValueDTO { Id = employeeJobCustomFieldValue.JobCustomFieldId.SharedJobCustomFieldId.Id, Value = employeeJobCustomFieldValue.JobCustomFieldValue }); } employeeJobPosition.EmployeeJobPositionAssignmentList.Add(employeeJobPositionAssignmentDTO); } return(employeeJobPosition); }
private JobPositionDuration GetJobPositionDurationWithCustomFields(long periodId, EmployeeJobPositionAssignmentDTO jp) { var jobPositionInPeriod = jobPositionRep.GetBy(new JobPositionId(new PeriodId(periodId), new SharedJobPositionId(jp.JobPositionId))); var job = jobRep.GetById(jobPositionInPeriod.JobId); var employeeJobCustomFieldValueList = job.CustomFields.Select(r => new EmployeeJobCustomFieldValue(r.Id , jp.CustomFieldValueList.Single(j => j.Id == r.SharedJobCustomField.Id.Id).Value)).ToList(); var jpDuration = new JobPositionDuration { FromDate = jp.FromDate, ToDate = jp.ToDate, JobPositionId = new JobPositionId(new PeriodId(periodId), new SharedJobPositionId(jp.JobPositionId)), WorkTimePercent = jp.WorkTimePercent, JobPositionWeight = jp.JobPositionWeight, EmployeeJobCustomFieldValues = employeeJobCustomFieldValueList }; return(jpDuration); }