private void PasteTable(CustomViewCollection customViewCollection, XmlNode tableNode, XmlNode columnListNode)
        {
            try
            {
                var customView = customViewCollection.Add();
                var id         = customView.Id;
                customView.XmlLoad(tableNode);
                customView.SetId(id);
                customView.SetKey(Guid.NewGuid().ToString());
                customView.Name = "[" + customView.Name + "]";
                customView.Columns.Clear();

                foreach (XmlNode child in columnListNode)
                {
                    var column = ((ModelRoot)this.Object.Root).Database.CustomViewColumns.Add();
                    id = column.Id;
                    column.XmlLoad(child);
                    column.SetId(id);
                    column.SetKey(Guid.NewGuid().ToString());
                    customView.Columns.Add(column.CreateRef());
                    column.ParentViewRef = customView.CreateRef();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
示例#2
0
        //private DateTime _createdDate = DateTime.Now;

        #endregion

        #region Constructor

        public Database(INHydrateModelObject root)
            : base(root)
        {
            _tables = new TableCollection(root);
            _tables.ResetKey(Guid.Empty.ToString());
            _columns = new ColumnCollection(root);
            _columns.ResetKey(Guid.Empty.ToString());
            _relations = new RelationCollection(root);
            _relations.ResetKey(Guid.Empty.ToString());
            _viewRelations = new ViewRelationCollection(root);
            _viewRelations.ResetKey(Guid.Empty.ToString());
            _customViews = new CustomViewCollection(root);
            _customViews.ResetKey(Guid.Empty.ToString());
            _customAggregates = new CustomAggregateCollection(root);
            _customAggregates.ResetKey(Guid.Empty.ToString());
            _customStoredProcedures = new CustomStoredProcedureCollection(root);
            _customStoredProcedures.ResetKey(Guid.Empty.ToString());
            _customViewColumns = new CustomViewColumnCollection(root);
            _customViewColumns.ResetKey(Guid.Empty.ToString());
            _customAggregateColumns = new CustomAggregateColumnCollection(root);
            _customAggregateColumns.ResetKey(Guid.Empty.ToString());
            _customStoredProcedureColumns = new CustomStoredProcedureColumnCollection(root);
            _customStoredProcedureColumns.ResetKey(Guid.Empty.ToString());
            _customRetrieveRules = new CustomRetrieveRuleCollection(root);
            _customRetrieveRules.ResetKey(Guid.Empty.ToString());
            _customRetrieveRuleParameters = new ParameterCollection(root);
            _customRetrieveRuleParameters.ResetKey(Guid.Empty.ToString());
            _functionParameters = new ParameterCollection(root);
            _functionParameters.ResetKey(Guid.Empty.ToString());
            _functions = new FunctionCollection(root);
            _functions.ResetKey(Guid.Empty.ToString());
            _functionColumns = new FunctionColumnCollection(root);
            _functionColumns.ResetKey(Guid.Empty.ToString());

            this.PrecedenceOrderList = new List <Guid>();
        }