Ejemplo n.º 1
0
        internal UDTHandler(ProjectHandler project, XmlElement source)
        {
            Parent = project;
            Tables = new List<UDTTable>();
            AllUDTTables = new List<UDTTable>();

            _allUDTs = new List<string>();

            XmlHelper h = new XmlHelper(source);

            XmlHelper ph = new XmlHelper(project.Preference);
            List<string> list = new List<string>();
            foreach (XmlElement e in ph.GetElements("Property/UDT"))
            {
                string name = e.GetAttribute("Name");
                list.Add(name.ToLower());
                _allUDTs.Add(name);
            }

            foreach (XmlElement tableElement in h.GetElements("TableName"))
            {
                UDTTable table = new UDTTable(tableElement.InnerText);
                if (list.Contains(table.Name.ToLower()))
                    Tables.Add(table);
                _allUDTs.Add(table.Name.ToLower());
                AllUDTTables.Add(table);
            }
        }
Ejemplo n.º 2
0
        internal UDTHandler(ProjectHandler project, XmlElement source)
        {
            Parent       = project;
            Tables       = new List <UDTTable>();
            AllUDTTables = new List <UDTTable>();

            _allUDTs = new List <string>();

            XmlHelper h = new XmlHelper(source);

            XmlHelper     ph   = new XmlHelper(project.Preference);
            List <string> list = new List <string>();

            foreach (XmlElement e in ph.GetElements("Property/UDT"))
            {
                string name = e.GetAttribute("Name");
                list.Add(name.ToLower());
                _allUDTs.Add(name);
            }

            foreach (XmlElement tableElement in h.GetElements("TableName"))
            {
                UDTTable table = new UDTTable(tableElement.InnerText);
                if (list.Contains(table.Name.ToLower()))
                {
                    Tables.Add(table);
                }
                _allUDTs.Add(table.Name.ToLower());
                AllUDTTables.Add(table);
            }
        }
Ejemplo n.º 3
0
        internal void JoinProject(UDTTable table)
        {
            List <UDTTable> tables = new List <UDTTable>();

            tables.Add(table);
            JoinProjects(tables);
        }
Ejemplo n.º 4
0
        internal void DropTable(string tableName)
        {
            tableName = tableName.ToLower();

            UDTTable targetTable = null;

            foreach (UDTTable table in Tables)
            {
                if (string.Equals(table.Name, tableName, StringComparison.CurrentCultureIgnoreCase))
                {
                    targetTable = table;
                    break;
                }
            }
            //原本這段是要限制僅能刪除專案內的資料表, 但之後不限制了, 故註解
            //if (targetTable == null) return;

            XmlHelper req = new XmlHelper("<Request/>");

            req.AddElement(".", "TableName", tableName);
            Parent.SendRequest("UDTService.DDL.DropTable", new Envelope(req));

            if (targetTable != null)
            {
                LeaveProject(targetTable);
            }
        }
Ejemplo n.º 5
0
        internal void LeaveProject(UDTTable table)
        {
            List <UDTTable> tables = new List <UDTTable>();

            tables.Add(table);
            LeaveProjects(tables);
        }
Ejemplo n.º 6
0
 internal EditDataForm(UDTTable udtTable)
 {
     InitializeComponent();
     Table = udtTable;
     Filters = QueryFilter.Empty;
     _filterForm = new FilterConditionForm(this);
 }
        internal TableNodeHandler(TreeNode node, UDTTable table)
        {
            Node = node;
            Table = table;

            this.Editors = new List<IEditable>();
            IEditable uieditor = new TableUIEditable("資料表-" + Table.Name, this);
            Editors.Add(uieditor);

            IEditable xmlEditor = new TableXmlEditable("資料表-" + Table.Name, this);
            Editors.Add(xmlEditor);

            CurrentEditor = uieditor;
        }
Ejemplo n.º 8
0
        internal void SetTable(XmlElement xmlElement)
        {
            string   tableName = xmlElement.GetAttribute("Name");
            UDTTable table     = this.GetProjectTable(tableName);

            XmlHelper h = new XmlHelper(xmlElement);

            Parent.SendRequest("UDTService.DDL.SetTable", new Envelope(h));

            if (table != null)
            {
                return;
            }

            this.JoinProject(UDTTable.CreateNew(tableName));
        }
Ejemplo n.º 9
0
        internal UDTTable CreateTable(string tableName)
        {
            tableName = tableName.ToLower();
            XmlHelper req = new XmlHelper("<Request/>");

            req.AddElement(".", "TableName", tableName);
            Parent.SendRequest("UDTService.DDL.CreateTable", new Envelope(req));

            _allUDTs.Add(tableName);
            UDTTable table = UDTTable.CreateNew(tableName);

            AllUDTTables.Add(table);

            JoinProject(table);

            return(table);
        }
Ejemplo n.º 10
0
        internal void SetTables(XmlElement tablesElement, bool import)
        {
            XmlHelper       h  = new XmlHelper(tablesElement);
            List <UDTTable> jp = new List <UDTTable>();
            List <UDTTable> lp = new List <UDTTable>();

            foreach (XmlElement tableElement in h.GetElements("Table"))
            {
                string   tableName = tableElement.GetAttribute("Name");
                UDTTable table     = this.GetProjectTable(tableName);

                if (table == null)
                {
                    jp.Add(UDTTable.CreateNew(tableName));
                }
            }

            foreach (UDTTable table in this.Tables)
            {
                bool contains = false;
                foreach (XmlElement tableElement in h.GetElements("Table"))
                {
                    string tableName = tableElement.GetAttribute("Name");
                    if (table.Name.ToLower() == tableName.ToLower())
                    {
                        contains = true;
                        break;
                    }
                }

                if (!contains && import)
                {
                    lp.Add(table);
                }
            }

            Parent.SendRequest("UDTService.DDL.SetTables", new Envelope(h));

            this.ModifyProject(jp, lp);
        }
Ejemplo n.º 11
0
 internal void LeaveProject(UDTTable table)
 {
     List<UDTTable> tables = new List<UDTTable>();
     tables.Add(table);
     LeaveProjects(tables);
 }
Ejemplo n.º 12
0
 internal void JoinProject(UDTTable table)
 {
     List<UDTTable> tables = new List<UDTTable>();
     tables.Add(table);
     JoinProjects(tables);
 }
 internal JoinableTableNodeHandler(TreeNode node, UDTTable table)
     : base(node, table)
 {
 }
Ejemplo n.º 14
0
 internal FKForm(UDTTable uDTTable, DataGridView dgFields)
 {
     this.UDTTable = uDTTable;
     this._dgFields = dgFields;
     InitializeComponent();
 }