private JobInPeriodDTO createDestinationJobInPeriod(JobDTO job, List <JobIndexIntegrationDTO> selectedSourceJobindices) { //var sourceTranferIdList=selectedSourceJobindices.Select(s=>s.TransferId); var selectedJobIndexIdListLong = new List <long>(); foreach (var item in selectedSourceJobindices) { var tempJobIndex = jobIndexList.First(j => j.TransferId == item.TransferId); selectedJobIndexIdListLong.Add(tempJobIndex.Id); } //var selectedJobIndexIdList = jobIndexList.Where(j => sourceTranferIdList.Contains(j.TransferId)).Select(j => j.Id); var res = new JobInPeriodDTO { Name = job.Name, CustomFields = new List <CustomFieldDTO>(), JobId = job.Id, //ParentId = parentId, JobIndices = jobIndexInperiodList.Where(j => selectedJobIndexIdListLong.Contains(j.JobIndexId)).Select(c => new JobInPeriodJobIndexDTO { Id = c.Id, Name = c.Name, IsInquireable = c.IsInquireable, ShowforLowLevel = true, ShowforSameLevel = true, ShowforTopLevel = true }).ToList() }; return(res); }
//public void Load(JobInPrdField jobInPrdFieldParam, ActionType actionTypeParam) public void Load(long periodId, JobInPeriodDTO jobInPeriod, ActionType actionTypeParam) { if (jobInPeriod == null) { return; } actionType = actionTypeParam; preLoad(periodId); ShowBusyIndicator("در حال دریافت اطلاعات..."); jobService.GetJob((res, exp) => appController.BeginInvokeOnDispatcher(() => { HideBusyIndicator(); if (exp == null) { Job = res; JobCustomFieldDescriptionList = new List <AbstractCustomFieldDescriptionDTO>(Job.CustomFields .Select(f => new AbstractCustomFieldDescriptionDTO() { Name = f.Name, Id = f.Id }).ToList()); jobCustomFieldDescriptionList.Where(allFields => jobInPeriod.CustomFields.Select(f => f.Id).Contains(allFields.Id)) .ToList() .ForEach(field => field.IsChecked = true); } else { appController.HandleException(exp); } }), jobInPeriod.JobId); }
public void ShowJobInPeriodJobIndicesManageView(long periodId, JobInPeriodDTO jobInPeriod, ActionType actionType) { var view = ServiceLocator.Current.GetInstance <IJobInPeriodJobIndicesView>(); ((JobInPeriodJobIndicesVM)view.ViewModel).Load(periodId, jobInPeriod, actionType); viewManager.ShowInDialog(view); }
public JobInPeriodDTO UpdateJob(long periodId, JobInPeriodDTO jobInPeriod) { var job = jobService.UpdateJob(new JobId(new PeriodId(periodId), new SharedJobId(jobInPeriod.JobId)), jobInPeriod.CustomFields.Select(c => new SharedJobCustomFieldId(c.Id)).ToList(), jobInPeriod.JobIndices.Select(c => new JobIndexForJob(new AbstractJobIndexId(c.Id), c.ShowforTopLevel, c.ShowforSameLevel, c.ShowforLowLevel)).ToList() ); return(jobInPeriodDTOMapper.MapToModel(job, new string[] {})); }
public void Load(long periodId, JobInPeriodDTO jobInPeriodParam, ActionType actionTypeParam) { if (jobInPeriodParam == null) { return; } JobInPeriod = jobInPeriodParam; actionType = actionTypeParam; preLoad(periodId); jobIndexInPeriodService.GetAllPeriodJobIndexes((res, exp) => appController.BeginInvokeOnDispatcher(() => { if (exp == null) { foreach (var jobIndex in res) { var jobInPeriodJobIndex = JobInPeriod.JobIndices.SingleOrDefault(j => j.Id == jobIndex.Id); if (jobInPeriodJobIndex != null) { jobInPeriodJobIndex.IsChecked = true; JobIndexInPeriodList.Add(jobInPeriodJobIndex); } else { JobIndexInPeriodList.Add(new JobInPeriodJobIndexDTO { Id = jobIndex.Id, Name = jobIndex.Name, IsInquireable = jobIndex.IsInquireable, ShowforLowLevel = true, ShowforSameLevel = true, ShowforTopLevel = true }); } } HideBusyIndicator(); } else { HideBusyIndicator(); appController.HandleException(exp); } }), periodId); }
public JobInPeriodDTO AddJobInPeriod(long periodId, JobInPeriodDTO jobInPeriodDto) { return(IntegrationHttpClient.Post <JobInPeriodDTO, JobInPeriodDTO>(apiUri, makeEndPoint(periodId), jobInPeriodDto)); //var url = string.Format(baseAddress + makeApiAdress(periodId)); //IntegrationWebClient.Post(new Uri(url, PMSClientConfig.UriKind), action, jobInPeriodDto, PMSClientConfig.MsgFormat, PMSClientConfig.CreateHeaderDic(userProvider.Token)); }
public JobInPeriodDTO PostJob(long periodId, JobInPeriodDTO jobInPeriod) { return(periodJobService.AssignJob(periodId, jobInPeriod)); }
public JobInPeriodDTO PutJob(long periodId, JobInPeriodDTO jobInPeriod) { //update customFields return(periodJobService.UpdateJob(periodId, jobInPeriod)); }
public void UpdateJobInPeriod(Action <JobInPeriodDTO, Exception> action, long periodId, JobInPeriodDTO jobInPeriod) { var url = string.Format(baseAddress + makeApiAdress(periodId)); WebClientHelper.Put(new Uri(url, PMSClientConfig.UriKind), action, jobInPeriod, PMSClientConfig.MsgFormat, PMSClientConfig.CreateHeaderDic(userProvider.Token)); }