Exemplo n.º 1
0
        public void AddDecimalNumber(
            Table table,
            string name,
            TSQLType sqlType,
            int?precision         = null,
            int?scale             = null,
            bool isNullable       = true,
            bool isPrimaryKey     = false,
            bool isIndexed        = false,
            string description    = null,
            string formForperties = null)
        {
            CheckAttributeName(table: table, name: name);

            DecimalNumber decimalNumber = new DecimalNumber(
                name: name,
                sqlType: sqlType,
                precision: precision,
                scale: scale,
                isNullable: isNullable,
                isPrimaryKey: isPrimaryKey,
                isIndexed: isIndexed,
                description: description,
                formSettings: formForperties)
            {
                TableId = table.Id
            };

            _attributeRepository.Add(entity: decimalNumber);
        }
Exemplo n.º 2
0
        public void AddString(
            Table table,
            string name,
            TSQLType sqlType,
            bool isNullable       = true,
            bool isPrimaryKey     = false,
            bool isIndexed        = false,
            uint?length           = null,
            string defaultValue   = null,
            string description    = null,
            string formProperties = null)
        {
            CheckAttributeName(table: table, name: name);

            String attribute = new String(
                name: name,
                sqlType: sqlType,
                isNullable: isNullable,
                isPrimaryKey: isPrimaryKey,
                isIndexed: isIndexed,
                length: length,
                defaultValue: defaultValue,
                description: description,
                formSettings: formProperties)
            {
                TableId = table.Id
            };

            _attributeRepository.Add(entity: attribute);
        }
Exemplo n.º 3
0
        public void AddRealNumber(
            Table table,
            string name,
            TSQLType sqlType,
            int?bitCapacity,
            bool isNullable       = true,
            bool isPrimaryKey     = false,
            bool isIndexed        = false,
            string description    = null,
            string formForperties = null)
        {
            CheckAttributeName(table: table, name: name);

            RealNumber realNumber = new RealNumber(
                name: name,
                sqlType: sqlType,
                bitCapacity: bitCapacity,
                isNullable: isNullable,
                isPrimaryKey: isPrimaryKey,
                isIndexed: isIndexed,
                description: description,
                formSettings: formForperties)
            {
                TableId = table.Id
            };

            _attributeRepository.Add(entity: realNumber);
        }
Exemplo n.º 4
0
 protected internal IntegerNumber(
     string name,
     TSQLType sqlType,
     bool isNullable     = true,
     bool isPrimaryKey   = false,
     bool isIndexed      = false,
     string description  = null,
     string formSettings = null)
     : base(
         name: name,
         sqlType: sqlType,
         isNullable: isNullable,
         isPrimaryKey: isPrimaryKey,
         isIndexed: isIndexed,
         description: description,
         formSettings: formSettings)
 {
 }
Exemplo n.º 5
0
 /// <summary>
 /// TSQL(TSQLType) 构造函数
 /// </summary>
 /// <param name="_type">Sql命令类型</param>
 /// <param name="_tableName">Table名称(选填)</param>
 public TSQL(TSQLType _type, string _tableName = "")
 {
     this.Type   = _type;
     this.Tables = new TableCollection();
     if (_tableName != "")
     {
         this.Tables.Add(_tableName);
     }
     this.Fields     = new FieldCollection();
     this.Outputs    = new OutputCollection();
     this.Wheres     = new WhereCollection();
     this.Groups     = new GroupCollection();
     this.Havings    = new WhereCollection();
     this.Orders     = new OrderCollection();
     this.Procedures = "";
     this.Parameters = new List <Parameter>();
     this.Limit      = 0;
     this.Offset     = 0;
 }
Exemplo n.º 6
0
 protected internal RealNumber(
     string name,
     TSQLType sqlType,
     int?bitCapacity     = null,
     bool isNullable     = true,
     bool isPrimaryKey   = false,
     bool isIndexed      = false,
     string description  = null,
     string formSettings = null)
     : base(
         name: name,
         sqlType: sqlType,
         isNullable: isNullable,
         isPrimaryKey: isPrimaryKey,
         isIndexed: isIndexed,
         description: description,
         formSettings: formSettings)
 {
     ChangeBitCapacity(bitCapacity: bitCapacity);
 }
Exemplo n.º 7
0
        protected Attribute(
            string name,
            TSQLType sqlType,
            bool isNullable     = true,
            bool isPrimaryKey   = false,
            bool isIndexed      = false,
            string description  = null,
            string formSettings = null)
        {
            Name = name ?? throw new ArgumentNullException(nameof(name));

            ChangeType(type: sqlType);

            ChangeIsNullable(isNullable: isNullable);
            ChangeIsPrimaryKey(isPrimaryKey: isPrimaryKey);
            ChangeIsIndexed(isIndexed: isIndexed);

            ChangeDescriotion(description: description);
            ChangeFormSettings(formSettings: formSettings);
        }
Exemplo n.º 8
0
 protected internal String(
     string name,
     TSQLType sqlType,
     bool isNullable     = true,
     bool isPrimaryKey   = false,
     bool isIndexed      = false,
     uint?length         = null,
     string defaultValue = null,
     string description  = null,
     string formSettings = null)
     : base(
         name: name,
         sqlType: sqlType,
         isNullable: isNullable,
         isPrimaryKey: isPrimaryKey,
         isIndexed: isIndexed,
         description: description,
         formSettings: formSettings)
 {
     ChangeMaxLength(length: length);
     DefaultValue = defaultValue;
 }
Exemplo n.º 9
0
 protected internal DecimalNumber(
     string name,
     TSQLType sqlType,
     int?precision       = null,
     int?scale           = null,
     bool isNullable     = true,
     bool isPrimaryKey   = false,
     bool isIndexed      = false,
     string description  = null,
     string formSettings = null)
     : base(
         name: name,
         sqlType: sqlType,
         isNullable: isNullable,
         isPrimaryKey: isPrimaryKey,
         isIndexed: isIndexed,
         description: description,
         formSettings: formSettings)
 {
     ChangePrecision(precision: precision);
     ChangeScale(scale: scale);
 }
Exemplo n.º 10
0
        public void ChangeType(TSQLType type)
        {
            SqlType = type;

            OnModified();
        }
Exemplo n.º 11
0
 public bool IsValidType(Type attributeType, TSQLType sqlType)
 {
     return(Types[key : attributeType]?.Contains(item : sqlType) ?? false);
 }