Esempio n. 1
0
 public static object ToApiValue(
     this string self,
     Context context,
     SiteSettings ss,
     Column column,
     string delimiter        = ", ",
     ExportColumn.Types type = ExportColumn.Types.Text)
 {
     return(self);
 }
 public static object ToApiDisplayValue(
     this string value,
     Context context,
     SiteSettings ss,
     Column column,
     string delimiter        = ", ",
     ExportColumn.Types type = ExportColumn.Types.Text)
 {
     if (column.HasChoices())
     {
         if (column.MultipleSelections == true)
         {
             var choiceParts = column.ChoiceParts(
                 context: context,
                 selectedValues: value,
                 type: type);
             return(column.MultipleSelections == true
                 ? choiceParts.Join(delimiter)
                 : choiceParts.FirstOrDefault());
         }
         else
         {
             column.AddToChoiceHash(
                 context: context,
                 value: value);
             var choice = column.Choice(
                 value,
                 nullCase: value.IsNullOrEmpty()
                     ? null
                     : "? " + value);
             return(choice.Text);
         }
     }
     else
     {
         return(value);
     }
 }