Beispiel #1
0
        private ExcelImportDetailDTO GetListSettings(Dictionary <string, object> field, Dictionary <string, object> settings, string itemType)
        {
            var querySettingsStr = field.GetValue("QuerySettings");
            var querySettings    = new Dictionary <string, object>();

            if (!string.IsNullOrEmpty(querySettingsStr))
            {
                querySettings = JsonHelper.ToObject(querySettingsStr);
            }
            var enumType             = (ListItemType)Enum.Parse(typeof(ListItemType), itemType);
            ExcelImportDetailDTO dto = new ExcelImportDetailDTO();

            switch (enumType)
            {
            case ListItemType.DatePicker:
                dto.Format = settings.GetValue("dateFormat");
                break;

            case ListItemType.CheckBoxList:
            case ListItemType.RadioButtonList:
            case ListItemType.ComboBox:
            case ListItemType.CheckBox:
                dto.EnumKey    = settings.GetValue("EnumKey");
                dto.IsMultiple = querySettings.GetValue("multiSelect");
                break;

            case ListItemType.ButtonEdit:
                dto.SelectorKey = querySettings.GetValue("SelectorKey");
                break;
            }
            return(dto);
        }
Beispiel #2
0
        private ExcelImportDetailDTO GetFormSettings(Dictionary <string, object> field, Dictionary <string, object> settings, string itemType)
        {
            var enumType             = (FormItemType)Enum.Parse(typeof(FormItemType), itemType);
            ExcelImportDetailDTO dto = new ExcelImportDetailDTO();

            switch (enumType)
            {
            case FormItemType.DatePicker:
                dto.Format = settings.GetValue("format");
                break;

            case FormItemType.CheckBoxList:
            case FormItemType.RadioButtonList:
            case FormItemType.ComboBox:
            case FormItemType.CheckBox:
                dto.EnumKey    = settings.GetValue("data");
                dto.IsMultiple = settings.GetValue("multiSelect");
                break;

            case FormItemType.ButtonEdit:
                dto.SelectorKey = settings.GetValue("SelectorKey");
                dto.IsMultiple  = settings.GetValue("AllowMultiSelect");
                break;

            case FormItemType.TextBox:
            case FormItemType.TextArea:
            case FormItemType.UEditor:
            case FormItemType.SingleFile:
            case FormItemType.MultiFile:
            case FormItemType.AuditSign:
            case FormItemType.Spinner:
            case FormItemType.LinkEdit:
                break;
            }
            return(dto);
        }