Esempio n. 1
0
 public string CreateCustomField(
     string fieldName,
     CustomFieldDataType dataType,
     List<string> options)
 {
     return CreateCustomField(fieldName, dataType, options, true);
 }
Esempio n. 2
0
 public string CreateCustomField(
     string fieldName,
     CustomFieldDataType dataType,
     List <string> options)
 {
     return(CreateCustomField(fieldName, dataType, options, true));
 }
Esempio n. 3
0
 public string CreateCustomField(string fieldName, CustomFieldDataType dataType, List<string> options)
 {
     string json = HttpHelper.Post(string.Format("/lists/{0}/customfields.json", _listID), null, JavaScriptConvert.SerializeObject(
         new Dictionary<string, object>() { { "FieldName", fieldName }, { "DataType", dataType.ToString() }, { "Options", options } })
         );
     return JavaScriptConvert.DeserializeObject<string>(json);
 }
Esempio n. 4
0
 public string CreateCustomField(string fieldName, CustomFieldDataType dataType, List<string> options)
 {
     return HttpHelper.Post<Dictionary<string, object>, string>(
         string.Format("/lists/{0}/customfields.json", ListID), null,
         new Dictionary<string, object>()
         {
             { "FieldName", fieldName },
             { "DataType", dataType.ToString() },
             { "Options", options }
         });
 }
Esempio n. 5
0
        public string CreateCustomField(string fieldName, CustomFieldDataType dataType, List <string> options)
        {
            string json = HttpHelper.Post(string.Format("/lists/{0}/customfields.json", _listID), null, JavaScriptConvert.SerializeObject(
                                              new Dictionary <string, object>()
            {
                { "FieldName", fieldName }, { "DataType", dataType.ToString() }, { "Options", options }
            })
                                          );

            return(JavaScriptConvert.DeserializeObject <string>(json));
        }
Esempio n. 6
0
        public string CreateCustomField(string listId, string name, CustomFieldDataType type)
        {
            var list          = new List(auth, listId);
            var sanitizedName = SanitizeKeyName(name);

            try
            {
                return(list.CreateCustomField(sanitizedName, type, null));
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("Error creating custom field '{0}'. {1}", name, ex.Message));
            }
        }
Esempio n. 7
0
 public string CreateCustomField(
     string fieldName,
     CustomFieldDataType dataType,
     List <string> options,
     bool visibleInPreferenceCenter)
 {
     return(HttpPost <Dictionary <string, object>, string>(
                string.Format("/lists/{0}/customfields.json", ListID), null,
                new Dictionary <string, object>()
     {
         { "FieldName", fieldName },
         { "DataType", dataType.ToString() },
         { "Options", options },
         { "VisibleInPreferenceCenter", visibleInPreferenceCenter }
     }));
 }
Esempio n. 8
0
 public string CreateCustomField(
     string fieldName,
     CustomFieldDataType dataType,
     List<string> options,
     bool visibleInPreferenceCenter)
 {
     return HttpPost<Dictionary<string, object>, string>(
         string.Format("/lists/{0}/customfields.json", ListID), null,
         new Dictionary<string, object>()
         {
             { "FieldName", fieldName },
             { "DataType", dataType.ToString() },
             { "Options", options },
             { "VisibleInPreferenceCenter", visibleInPreferenceCenter }
         });
 }