示例#1
0
 public AFieldTable(string name, string discript)
 {
     TableName     = name;
     TableDiscript = discript;
     TableFields.Add(new TableField()
     {
         Name     = "ID",
         Type     = "int identity(1,1) primary key not null",
         IsExtend = true
     });
     CommonFields.AddRange(
         new TableField[] {
         new TableField()
         {
             Name     = "修改人",
             Type     = TableField.FieldTypeList[TableFieldType.文本],
             IsExtend = true,
         },
         new TableField()
         {
             Name     = "修改时间",
             Type     = TableField.FieldTypeList[TableFieldType.日期时间],
             IsExtend = true,
             Value    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
         },
     });
 }
示例#2
0
 public override void AddField(TableField field)
 {
     foreach (TableField f in TableFields)
     {
         if (f.Name == field.Name)
         {
             f.Value = field.Value;
             return;
         }
     }
     if (CommonFields.Select(f => f.Name).Contains(field.Name))
     {
         field.IsExtend = true;
     }
     TableFields.Add(field);
 }