/// <summary> /// Format the given picklist item according to the specified mode. /// </summary> /// <param name="item"></param> /// <param name="picklistMode"></param> /// <returns></returns> private string FormatText(PickList item, PicklistStorageMode picklistMode) { String txt = ""; if ((picklistMode & PicklistStorageMode.Code) != 0) { if (txt != "") { txt += " - "; } txt += item.Shorttext; } if ((picklistMode & PicklistStorageMode.Id) != 0) { if (txt != "") { txt += " - "; } txt += item.ItemId; } if ((picklistMode & PicklistStorageMode.Text) != 0) { if (txt != "") { txt += " - "; } txt += item.Text; } return(txt); }
/// <summary> /// Format the given picklist item according to the specified mode. /// </summary> /// <param name="item"></param> /// <param name="picklistMode"></param> /// <returns></returns> private string FormatText(PickList item, PicklistStorageMode picklistMode) { String txt = ""; if ((picklistMode & PicklistStorageMode.Code) != 0) { if (txt != "") txt += " - "; txt += item.Shorttext; } if ((picklistMode & PicklistStorageMode.Id) != 0) { if (txt != "") txt += " - "; txt += item.ItemId; } if ((picklistMode & PicklistStorageMode.Text) != 0) { if (txt != "") txt += " - "; txt += item.Text; } return txt; }
/// <summary> /// Create a picklist item from a SalesLogix picklist object. /// Value and Text will be extracted from the picklist item based on display mode and storage mode. /// </summary> /// <param name="pkl"></param> /// <param name="displayMode"></param> /// <param name="storageMode"></param> public PicklistItemDisplay(PickList pkl, PicklistStorageMode displayMode, PicklistStorageMode storageMode) { Value = FormatText(pkl, storageMode); Text = FormatText(pkl, displayMode); }
/// <summary> /// Create adapter /// </summary> /// <param name="picklistName"></param> /// <param name="attr"></param> /// <param name="storageMode"></param> public PicklistPicklistAdapter(String picklistName, PickListAttributes attr, PicklistStorageMode storageMode) { _picklistName = picklistName; _attr = attr; _storageMode = storageMode; }