private void FindFieldPreFillValues(eFormCore.Core sdkCore)
        {
            List <Field_Dto> fieldDtos = sdkCore.Advanced_TemplateFieldReadAll(TemplateId);

            foreach (Field_Dto fieldDto in fieldDtos)
            {
                string value = FindValue($"F{fieldDto.Id}#");

                if (!string.IsNullOrEmpty(value))
                {
                    AppointmentPrefillFieldValue appointmentPrefillFieldValue = new AppointmentPrefillFieldValue(fieldDto.Id, value);
                    AppointmentPrefillFieldValues.Add(appointmentPrefillFieldValue);
                }
            }
        }
Exemplo n.º 2
0
        private async Task FindFieldPreFillValues(eFormCore.Core sdkCore)
        {
            await using MicrotingDbContext microtingDbContext = sdkCore.DbContextHelper.GetDbContext();
            Language language = await microtingDbContext.Languages.SingleAsync(x => x.LanguageCode == "da");

            List <FieldDto> fieldDtos = await sdkCore.Advanced_TemplateFieldReadAll(TemplateId, language);

            foreach (FieldDto fieldDto in fieldDtos)
            {
                string value = FindValue($"F{fieldDto.Id}#");

                if (!string.IsNullOrEmpty(value))
                {
                    AppointmentPrefillFieldValue appointmentPrefillFieldValue = new AppointmentPrefillFieldValue()
                    {
                        FieldId    = fieldDto.Id,
                        FieldValue = value
                    };
                    AppointmentPrefillFieldValues.Add(appointmentPrefillFieldValue);
                }
            }
        }