예제 #1
0
        public void RenameDomain(IDomainStructure domain, NameWithSchema newname)
        {
            DomainStructure dom = Structure.FindOrCreateDomain(domain);

            AddOperation(new AlterOperation_RenameDomain {
                OldObject = dom, NewName = newname
            });
        }
예제 #2
0
        public void CreateDomain(IDomainStructure domain)
        {
            DomainStructure dom = new DomainStructure(domain);

            AddOperation(new AlterOperation_CreateDomain {
                NewObject = dom
            });
        }
예제 #3
0
        public void DropDomain(IDomainStructure domain)
        {
            DomainStructure dom = Structure.FindOrCreateDomain(domain);

            AddOperation(new AlterOperation_DropDomain {
                OldObject = dom
            });
        }
예제 #4
0
        protected virtual void LoadDomain(DomainStructure domain, DataRow row)
        {
            domain.FullName = NewNameWithSchema(row.SafeString("DOMAIN_SCHEMA"), row.SafeString("DOMAIN_NAME"));
            domain.DataType = AnalyseType(new DataRowAdapter(row), m_conn, true);

            string def = row.SafeString("DOMAIN_DEFAULT");

            domain.DefaultValue = SqlExpression.ParseDefaultValue(GetDefaultValueExpression(def), m_dialect);
        }
예제 #5
0
        public void ChangeDomain(IDomainStructure domain, IDomainStructure newdomain)
        {
            DomainStructure dom    = Structure.FindOrCreateDomain(domain);
            DomainStructure newdom = new DomainStructure(newdomain);

            AddOperation(new AlterOperation_ChangeDomain {
                OldObject = dom, NewObject = newdom
            });
        }
예제 #6
0
        public void AddDomain(IDomainStructure domain, bool reuseGroupId)
        {
            var newdom = new DomainStructure(domain);

            if (!reuseGroupId)
            {
                newdom.GroupId = Guid.NewGuid().ToString();
            }
            Domains.Add(newdom);
        }
예제 #7
0
        //public IDatabaseSource TargetDb { get { return null; } }

        public DomainStructure FindOrCreateDomain(IDomainStructure domain)
        {
            DomainStructure res = FindDomain(domain.FullName);

            if (res != null)
            {
                return(res);
            }
            res = new DomainStructure(domain);
            Domains.Add(res);
            return(res);
        }
예제 #8
0
 protected virtual void LoadDomains()
 {
     if ((m_members.DomainDetails || m_members.DomainList) && m_dialect.DialectCaps.Domains)
     {
         //m_db.Domains = new DomainCollection();
         foreach (DataRow row in CachedQueryRows("SELECT * FROM INFORMATION_SCHEMA.DOMAINS"))
         {
             var dom = new DomainStructure();
             LoadDomain(dom, row);
             m_db.Domains.Add(dom);
         }
     }
 }
예제 #9
0
        public void Init(IDomainStructure domain, ISqlDialect dialect)
        {
            m_oldDomain = domain;
            if (domain == null)
            {
                m_domain          = new DomainStructure();
                m_domain.DataType = new DbTypeString();
            }
            else
            {
                m_domain = new DomainStructure(domain);
            }
            m_dialect = dialect;
            cbxDataType.Items.Clear();
            foreach (string code in Enum.GetNames(m_dialect.SpecificTypeEnum).Sorted())
            {
                cbxDataType.Items.Add(code);
            }
            m_dataType = m_dialect.GenericTypeToSpecific(m_domain.DataType);
            propertyGrid1.SelectedObject = m_dataType;

            cbxDataType.SelectedIndex = cbxDataType.Items.IndexOf(((ISpecificType)m_dataType).Code.ToString());
            chbNullable.Checked       = m_domain.IsNullable;
        }