public override AbstractIndex MapToModel(AbstractJobIndex entity) { if (entity is JobIndex) { var res = new JobIndexDTO() { Id = entity.Id.Id, Name = entity.Name, DictionaryName = entity.DictionaryName, TransferId = entity.TransferId, ParentId = ((JobIndex)entity).Category.Id.Id, }; return(res); } else { var res = new JobIndexCategoryDTO() { Id = entity.Id.Id, Name = entity.Name, DictionaryName = entity.DictionaryName, }; if (((JobIndexCategory)entity).Parent != null) { res.ParentId = ((JobIndexCategory)entity).Parent.Id.Id; } return(res); } }
public void ShowJobIndexCategoryView(JobIndexCategoryDTO jobIndexCategory, ActionType action) { var view = ServiceLocator.Current.GetInstance <IJobIndexCategoryView>(); ((JobIndexCategoryVM)view.ViewModel).Load(jobIndexCategory, action); viewManager.ShowInDialog(view); }
public JobIndexCategoryVM(IPMSController appController, IJobIndexServiceWrapper jobIndexCategoryService) { this.appController = appController; this.jobIndexCategoryService = jobIndexCategoryService; JobIndexCategory = new JobIndexCategoryDTO(); DisplayName = "دسته شاخص "; }
public AbstractIndex UpdateJobIndexCategory(JobIndexCategoryDTO jobIndexCatDto) { var jobIndexCat = jobIndexService.UpdateJobIndexCategory(new AbstractJobIndexId(jobIndexCatDto.Id) , (jobIndexCatDto.ParentId.HasValue) ? new AbstractJobIndexId(jobIndexCatDto.ParentId.Value) : null , jobIndexCatDto.Name, jobIndexCatDto.DictionaryName); return(jobIndexMapper.MapToModel(jobIndexCat)); }
public AbstractIndex AddJobIndexCategory(JobIndexCategoryDTO jobIndexCategoryDto) { var jobIndexCat = jobIndexService.AddJobIndexCategory( (jobIndexCategoryDto.ParentId == null) ? null : new AbstractJobIndexId(jobIndexCategoryDto.ParentId.Value), jobIndexCategoryDto.Name, jobIndexCategoryDto.DictionaryName); return(jobIndexMapper.MapToModel(jobIndexCat)); }
public void DoAction(JobIndexTreeVM vm) { var jobIndexCategory = new JobIndexCategoryDTO(); if (vm.SelectedJobIndex != null) { jobIndexCategory.ParentId = vm.SelectedJobIndex.Data.Id; } else { jobIndexCategory.ParentId = null; } basicInfoController.ShowJobIndexCategoryView(jobIndexCategory, ActionType.AddJobIndexCategory); }
public void Load(JobIndexCategoryDTO jobIndexCategoryParam, ActionType actionTypeParam) { actionType = actionTypeParam; JobIndexCategory = jobIndexCategoryParam; if (JobIndexCategory != null && jobIndexCategory.ParentId.HasValue) { ShowBusyIndicator(); jobIndexCategoryService.GetJobIndexCategory((res, exp) => appController.BeginInvokeOnDispatcher(() => { HideBusyIndicator(); ParentCategoryName = res.Name; }), jobIndexCategory.ParentId.Value); } }
public void UpdateJobIndexCategory(Action <JobIndexCategoryDTO, Exception> action, JobIndexCategoryDTO jobIndexCategory) { var url = string.Format(apiAddress + "?Id=" + jobIndexCategory.Id); WebClientHelper.Put(new Uri(url, PMSClientConfig.UriKind), action, jobIndexCategory, PMSClientConfig.MsgFormat, PMSClientConfig.CreateHeaderDic(userProvider.Token)); }
public void AddJobIndexCategory(Action <JobIndexCategoryDTO, Exception> action, JobIndexCategoryDTO jobIndexCategory) { var url = string.Format(apiAddress, UriKind.Absolute); WebClientHelper.Post(new Uri(url), action, jobIndexCategory, PMSClientConfig.MsgFormat, PMSClientConfig.CreateHeaderDic(userProvider.Token)); }
public JobIndexCategoryVM() { JobIndexCategory = new JobIndexCategoryDTO { Name = "شغل یک", DictionaryName = "JobIndexCategory1" }; }