Exemplo n.º 1
0
 public void savePhysicalToXML(String fpath, MetaDataPhysical obj)
 {
     serializer = new XmlSerializer(typeof(MetaDataPhysical));
     FileStream fs = new FileStream(fpath, FileMode.Create);
     serializer.Serialize(fs, obj);
     fs.Close();
 }
Exemplo n.º 2
0
        //My Method
        public MetaDataPhysical getMetaDataPhysical()
        {
            //Convert tất cả shape qua MetaDataPhysical
            MetaDataPhysical mdp = new MetaDataPhysical();

            //Duyệt tất cả controls trên Panel
            foreach (Control ctr in this.Controls)
            {
                TableShape tShape = (TableShape)ctr;
                mdp.Tables.Add(tShape.table);
                foreach (FKShape fkShape in tShape.listFK)
                {
                    ForeignKey fk = new ForeignKey();
                    fk.Name = fkShape.fkName;
                    fk.ParentTable = tShape.table.name;
                    fk.ParentColumn = fkShape.parentColumn;
                    fk.ChildTable = fkShape.tableReference.table.name;
                    fk.ChildColumn = fkShape.childColumn;
                    mdp.ForeignKeys.Add(fk);
                }
            }
            return mdp;
        }
Exemplo n.º 3
0
        public void drawMetaDataPhysical(MetaDataPhysical mdp)
        {
            //Vẽ MetaDataPhysical lên this Panel
            foreach (Table t in mdp.Tables)
            {
                TableShape ts = new TableShape(t);
                ts.Location = new Point(t.x, t.y);
                this.Controls.Add(ts);
            }
            foreach (ForeignKey fk in mdp.ForeignKeys)
            {
                TableShape shapePrimary = searchShapeInPannel(fk.ParentTable);
                TableShape shapeReference = searchShapeInPannel(fk.ChildTable);
                FKShape fkShape = new FKShape();
                fkShape.fkName = fk.Name;
                fkShape.tableReference = shapeReference;
                fkShape.childColumn = fk.ChildColumn;
                fkShape.parentColumn = fk.ParentColumn;
                shapePrimary.listFK.Add(fkShape);
            }

            this.Invalidate();
        }
Exemplo n.º 4
0
 public ScriptMSAccess(MetaDataPhysical mdp, string dbName)
 {
     this.mdp = mdp;
     this.dbName = dbName;
 }
Exemplo n.º 5
0
 public ScriptOracle(MetaDataPhysical mdp, string dbName)
 {
     this.mdp = mdp;
     this.dbName = dbName;
 }
Exemplo n.º 6
0
 //Constructor
 public GenerateScriptSQL(MainForm f, MetaDataPhysical mdPhysical)
 {
     InitializeComponent();
     frmMain = f;
     mdp = mdPhysical;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Phương thức khởi tạo GenerateDDL
 /// </summary>
 /// <param name="mdp">Meta data physical</param>
 /// <param name="nameDBMS">Loại Database Manage System</param>
 /// <param name="dbName">Tên Database</param>
 public GenerateDDL(MetaDataPhysical mdp, DBMS nameDBMS, string dbName)
 {
     this.mdp = mdp;
     this.nameDBMS = nameDBMS;
     this.dbName = dbName;
 }