Beispiel #1
0
        void InitTestTable()
        {
            data.TableName = "任务设置";
            SimuHelpers.GetTaskFields().ToList().ForEach(a =>
            {
                var new_column         = new DataColumn();
                new_column.ColumnName  = a.Name;
                new_column.DataType    = a.PropertyType;
                new_column.AllowDBNull = false;
                {
                    var attr = a.ConvertTo <DescriptionAttribute>();
                    if (attr != null)
                    {
                        new_column.Caption = attr.Description;
                    }
                }
                {
                    var attr = a.ConvertTo <DefaultValueAttribute>();
                    if (attr != null)
                    {
                        new_column.DefaultValue = attr.Value;
                    }
                }
                {
                    var attr = a.ConvertTo <UniqueAttribute>();
                    if (attr != null)
                    {
                        new_column.Unique = true;
                    }
                }

                data.Columns.Add(new_column);
            });
            InitTestData();
        }
Beispiel #2
0
 public RumtimeSchd(DataTable table)
 {
     this.table  = table;
     type_fields = SimuHelpers.GetTypeFields();
     task_fields = SimuHelpers.GetTaskFields();
 }