Exemple #1
0
        private void LoadPhyicalForm()
        {
            if (ActiveMdiChild != null && ActiveMdiChild.GetType().Name == "frmDrawBoard")
            {
                if (verifyModel())
                {
                    ((frmDrawBoard)ActiveMdiChild).pnlDrawBoard.EndEditDataType();
                    MetaData ERD = ((frmDrawBoard)ActiveMdiChild).pnlDrawBoard.getMetaData();

                    string formName = ActiveMdiChild.Text + "Physical";
                    Form   f        = findForm(formName);

                    if (f != null)
                    {
                        f.Close();
                    }

                    frmPhysicalDrawBoard frmPhysical = new frmPhysicalDrawBoard(ERD);
                    frmPhysical.Text      = formName;
                    frmPhysical.MdiParent = this;
                    frmPhysical.Show();

                    //frmPhysical.FormClosing += new FormClosingEventHandler(drawboard_FormClosing);
                }
            }
        }
Exemple #2
0
        private void OpenModel(string name, string type)
        {
            string pathfile;

            if (type == ModelType.Conceptual)
            {
                pathfile = currentProject.ProjectPath + "/" + name + ModelType.ConceptualExtention;
            }
            else
            {
                pathfile = currentProject.ProjectPath + "/" + name + ModelType.PhysicalExtention;
            }

            if (checkExistFile(name, type))
            {
                if (type == ModelType.Conceptual)
                {
                    frmDrawBoard drawboard = new frmDrawBoard();
                    drawboard.Text      = name;
                    drawboard.MdiParent = this;
                    drawboard.Show();

                    drawboard.pnlDrawBoard.drawMetaData(js.loadConceptualFromXML(pathfile));
                    drawboard.pnlDrawBoard.UndoList.Clear();
                    drawboard.pnlDrawBoard.saveUndoList();

                    drawboard.FormClosing += new FormClosingEventHandler(drawboard_FormClosing);
                }
                else
                {
                    frmPhysicalDrawBoard drawboard = new frmPhysicalDrawBoard();
                    drawboard.Text      = name;
                    drawboard.MdiParent = this;
                    drawboard.Show();

                    drawboard.pnlPhysical.drawMetaDataPhysical(js.loadPhysicalFromXML(pathfile));

                    drawboard.FormClosing += new FormClosingEventHandler(drawboard_FormClosing);
                }
            }
        }