Exemple #1
0
 private void getEmployeeCustomFields()
 {
     customFieldService.GetAllCustomFields((res, exp) => appController.BeginInvokeOnDispatcher(() =>
     {
         if (exp == null)
         {
             CustomFieldValueList =
                 CheckBoxListViewHelper <CustomFieldValueDTO> .PrepareListForCheckBoxListView(
                     res.Select(r => new CustomFieldValueDTO {
                 Id = r.Id, IsReadOnly = r.IsReadOnly, Name = r.Name
             }).ToList());
             if (actionType != ActionType.ModifyEmployee || Employee.CustomFields == null)
             {
                 return;
             }
             foreach (var itm in CustomFieldValueList)
             {
                 if (Employee.CustomFields.Select(c => c.Id).Contains(itm.Data.Id))
                 {
                     itm.IsChecked  = true;
                     itm.Data.Value = Employee.CustomFields.Single(e => e.Id == itm.Data.Id).Value;
                 }
                 else
                 {
                     itm.IsChecked = false;
                 }
             }
         }
         else
         {
             appController.HandleException(exp);
         }
     }), "Employee");
 }
Exemple #2
0
        public void Handle(UpdateJobIndexCustomFieldListArgs eventData)
        {
            JobIndex.CustomFields = new List <CustomFieldDTO>();
            var fieldIdList = eventData.JobIndexCustomFieldDescriptionList.Select(f => f.Id).ToList();

            customFieldService.GetAllCustomFields((res, exp) => appController.BeginInvokeOnDispatcher(() =>
            {
                if (exp == null)
                {
                    JobIndex.CustomFields = res.Where(r => fieldIdList.Contains(r.Id)).ToList();
                }
                else
                {
                    appController.HandleException(exp);
                }
            }), "JobIndex");
        }
Exemple #3
0
        public void Handle(UpdateUnitCustomFieldListArgs eventData)
        {
            Unit.CustomFields = new ObservableCollection <CustomFieldDTO>();
            var fieldIdList = eventData.UnitCustomFieldDescriptionList.Select(f => f.Id).ToList();

            customFieldService.GetAllCustomFields((res, exp) => appController.BeginInvokeOnDispatcher(() =>
            {
                if (exp == null)
                {
                    Unit.CustomFields = new ObservableCollection <CustomFieldDTO>(res.Where(f => fieldIdList.Contains(f.Id)));
                }
                else
                {
                    appController.HandleException(exp);
                }
            }), "Unit");
        }
Exemple #4
0
        public void Handle(UpdateJobInPeriodCustomFieldListArgs eventData)
        {
            if (Period.Id != eventData.PeriodId || SelectedJobInPeriod.JobId != eventData.JobId)
            {
                return;
            }

            SelectedJobInPeriod.CustomFields = new List <CustomFieldDTO>();
            var fieldIdList = eventData.JobInPeriodCustomFieldDescriptionList.Select(f => f.Id).ToList();

            customFieldService.GetAllCustomFields((res, exp) => appController.BeginInvokeOnDispatcher(() =>
            {
                if (exp == null)
                {
                    SelectedJobInPeriod.CustomFields = res.Where(f => fieldIdList.Contains(f.Id)).ToList();
                }
                else
                {
                    appController.HandleException(exp);
                }
            }), "Job");
        }