Пример #1
0
        void UserBO_OnUserExtendFieldChanged(ExtendedFieldCollection extendedFields)
        {
            ExtendedFieldProxy[] fields = new ExtendedFieldProxy[extendedFields.Count];

            int i = 0;
            foreach (ExtendedField field in extendedFields)
            {
                fields[i] = ProxyConverter.GetExtendedFieldProxy(field);
                i++;
            }

            CreateInstruct(0, InstructType.Setting_UpdateUserExtendedField, fields);
        }
Пример #2
0
        //public static ChatSessionFilterProxy GetChatSessionFilterProxy(ChatSessionFilter filter)
        //{
        //    if (filter == null)
        //        return null;
        //    ChatSessionFilterProxy proxy = new ChatSessionFilterProxy();
        //    proxy.BeginDate = filter.BeginDate;
        //    proxy.Contains = filter.Contains;
        //    proxy.EndDate = filter.EndDate;
        //    proxy.IsDesc = filter.IsDesc;
        //    proxy.PageSize = filter.PageSize;
        //    proxy.ShowAll = filter.ShowAll;
        //    proxy.UserID = filter.UserID;
        //    proxy.Username = filter.Username;

        //    return proxy;
        //}

        public static ExtendedFieldProxy GetExtendedFieldProxy(ExtendedField field)
        {
            if (field == null)
                return null;

            ExtendedFieldProxy proxy = new ExtendedFieldProxy();
            proxy.Description = field.Description;
            proxy.DisplayType = (int)field.DisplayType;
            proxy.FieldTypeName = field.FieldTypeName;
            proxy.IsRequired = field.IsRequired;
            proxy.Key = field.Key;
            proxy.Name = field.Name;
            proxy.Searchable = field.Searchable;
            proxy.Settings = new List<StringKeyValueProxy>();

            foreach (DictionaryEntry item in field.Settings)
            {
                string value;
                if (item.Value == null)
                    value = string.Empty;
                else
                    value = item.Value.ToString();
                StringKeyValueProxy temp = new StringKeyValueProxy(item.Key.ToString(), value);
                proxy.Settings.Add(temp);
            }

            proxy.SortOrder = field.SortOrder;

            return proxy;
        }