Exemple #1
0
        //public static TField[] ToFieldArray<TField>(this IEnumerable<CustomFieldCache.CustomFieldItem> items,
        //    ICollection<Field> collection, string namePrefix, Func<ICollection<Field>, string, LocalText, int, FieldFlags, TField> createField)
        //{
        //    var result = new List<Field>();
        //    foreach (var item in items)
        //    {
        //        var meta = new FieldMeta((namePrefix ?? "") + item.Name,
        //            ToLocalText(item.Caption), item.Size, item.Required ? Required : NotRequired);

        //        Field field = createField(meta);
        //        result.Add(field);
        //    }

        //    return result.ToArray();
        //}

        //public static TField[] ToFieldArray<TField>(this IEnumerable<CustomFieldCache.CustomFieldItem> items,
        //    ICollection<Field> collection, string namePrefix, Func<FieldMeta, TField> createField)
        //    where TField: Field
        //{
        //    var result = new List<TField>();
        //    foreach (var item in items)
        //    {
        //        var meta = new FieldMeta((namePrefix ?? "") + item.Name,
        //            ToLocalText(item.Caption), item.Size, item.Required ? Required : NotRequired);

        //        TField field = createField(meta);
        //        result.Add(field);
        //    }

        //    return result.ToArray();
        //}

        public static void DefaultFieldCaption(this RowFieldsBase fields, string fieldName, string caption)
        {
            LocalText.Add(new List <LocalText.Entry>()
            {
                new LocalText.Entry(LocalText.DefaultLanguageID, "Db." + fields.TableName + "." + fieldName,
                                    caption)
            }, false);
        }
Exemple #2
0
        protected Row(RowFieldsBase fields)
        {
            if (fields == null)
            {
                throw new ArgumentNullException("fields");
            }

            this.fields = fields.Init();

            TrackAssignments = true;
        }
 public static IDbConnection NewConnection(RowFieldsBase fields)
 {
     return(SqlConnections.NewByKey(fields.connectionKey));
 }