Esempio n. 1
0
 private DBForeignKey(DBColumn column)
 {
     this.ColumnName = column.ColumnName;
     this.DbType     = column.DbType;
     this.Length     = column.Length;
     this.AllowNull  = column.AllowNull;
 }
Esempio n. 2
0
 private DBForeignKey(DBColumn column)
 {
     this.ColumnName = column.ColumnName;
     this.DbType = column.DbType;
     this.Length = column.Length;
     this.AllowNull = column.AllowNull;
 }
Esempio n. 3
0
 public DBPrimaryKey(DBColumn column, bool isIdentity, int seed, int currentValue, int step)
     : this(column)
 {
     this.IsIdentity   = isIdentity;
     this.Seed         = seed;
     this.CurrentValue = currentValue;
     this.Step         = step;
 }
Esempio n. 4
0
 public JField(DBColumn column)
 {
     this.FieldName = column.ColumnName;
     this.ValueType = JField.GetJValueType(column.DbType);
     this.FirstOperand = new JOperateNum(this.FieldName, this.ValueType);
     this.AllowNull = column.AllowNull;
     if (column is DBPrimaryKey)
     {
         DBPrimaryKey pk = column as DBPrimaryKey;
         this.FirstOperand.ValueCategroy = JValueCategroy.Sequence;
         this.FirstOperand.MinValue = pk.CurrentValue + pk.Step;
         this.FirstOperand.Step = pk.Step;
     }
     if (column is DBForeignKey)
     {
         DBForeignKey fk = column as DBForeignKey;
         this.FirstOperand.ValueCategroy = JValueCategroy.FromTable;
         this.FirstOperand.ReferenceTableName = fk.ReferenceTableName;
         this.FirstOperand.ReferenceColumnName = fk.ReferenceColumnName;
     }
     this.Visible = false;
     this.Order = 0;
 }
Esempio n. 5
0
 public JField(DBColumn column)
 {
     this.FieldName    = column.ColumnName;
     this.ValueType    = JField.GetJValueType(column.DbType);
     this.FirstOperand = new JOperateNum(this.FieldName, this.ValueType);
     this.AllowNull    = column.AllowNull;
     if (column is DBPrimaryKey)
     {
         DBPrimaryKey pk = column as DBPrimaryKey;
         this.FirstOperand.ValueCategroy = JValueCategroy.Sequence;
         this.FirstOperand.MinValue      = pk.CurrentValue + pk.Step;
         this.FirstOperand.Step          = pk.Step;
     }
     if (column is DBForeignKey)
     {
         DBForeignKey fk = column as DBForeignKey;
         this.FirstOperand.ValueCategroy       = JValueCategroy.FromTable;
         this.FirstOperand.ReferenceTableName  = fk.ReferenceTableName;
         this.FirstOperand.ReferenceColumnName = fk.ReferenceColumnName;
     }
     this.Visible = false;
     this.Order   = 0;
 }
Esempio n. 6
0
 private DBPrimaryKey(DBColumn column)
 {
     this.ColumnName = column.ColumnName;
     this.DbType = column.DbType;
     this.Length = column.Length;
 }
Esempio n. 7
0
 public DBPrimaryKey(DBColumn column, bool isIdentity, int seed, int currentValue, int step)
     : this(column)
 {
     this.IsIdentity = isIdentity;
     this.Seed = seed;
     this.CurrentValue = currentValue;
     this.Step = step;
 }
Esempio n. 8
0
 public DBForeignKey(DBColumn column, string reftableName, string refColumnName)
     : this(column)
 {
     this.ReferenceColumnName = refColumnName;
     this.ReferenceTableName = reftableName;
 }
Esempio n. 9
0
 public void SetPrimaryKey(DBColumn column, bool isIdentity, int seed, int currentValue, int step)
 {
     this.PrimaryKey = new DBPrimaryKey(column, isIdentity, seed, currentValue, step);
     this.Columns.Remove(column);
 }
Esempio n. 10
0
 public void AddForeignKey(DBColumn column, string refTableName, string refColumnName)
 {
     this.ForeignKeys.Add(new DBForeignKey(column, refTableName, refColumnName));
     this.Columns.Remove(column);
 }
Esempio n. 11
0
        private void FillFields(DBTable table)
        {
            SqlDataReader rd = SqlHelper.ExecuteReader(new SqlConnection(this.ConnStr), CommandType.Text, string.Format(format_getAllFields, table.TableName), null);
            List<DBColumn> fields = new List<DBColumn>();

            while (rd.Read())
            {
                try
                {
                    DBColumn column = new DBColumn(rd["fieldName"].ToString());
                    string sqlDBType = rd["fieldType"].ToString();
                    column.DbType = (SqlDbType)Enum.Parse(typeof(SqlDbType), sqlDBType, true);
                    column.Length = int.Parse(rd["fieldLength"].ToString());
                    column.AllowNull = rd["allowNull"].ToString() == "1" ? true : false;
                    fields.Add(column);
                }
                catch (Exception ex)
                {
                }
            }
            rd.Close();
            rd.Dispose();
            table.Columns = fields;
        }
Esempio n. 12
0
 private DBPrimaryKey(DBColumn column)
 {
     this.ColumnName = column.ColumnName;
     this.DbType     = column.DbType;
     this.Length     = column.Length;
 }
Esempio n. 13
0
 public DBForeignKey(DBColumn column, string reftableName, string refColumnName)
     : this(column)
 {
     this.ReferenceColumnName = refColumnName;
     this.ReferenceTableName  = reftableName;
 }
Esempio n. 14
0
 public void AddForeignKey(DBColumn column, string refTableName, string refColumnName)
 {
     this.ForeignKeys.Add(new DBForeignKey(column, refTableName, refColumnName));
     this.Columns.Remove(column);
 }
Esempio n. 15
0
 public void SetPrimaryKey(DBColumn column, bool isIdentity, int seed, int currentValue, int step)
 {
     this.PrimaryKey = new DBPrimaryKey(column, isIdentity, seed, currentValue, step);
     this.Columns.Remove(column);
 }