コード例 #1
0
ファイル: Main.cs プロジェクト: dngo10/GOUVIS_PLUMBING_PLUGIN
        public void ReadData()
        {
            string dwgPath = Application.DocumentManager.MdiActiveDocument.Name;

            string dbPath = GoodiesPath.GetDatabasePathFromDwgPath(dwgPath);

            if (string.IsNullOrEmpty(dbPath))
            {
                MessageBox.Show("Couldn't find the database!");
                return;
            }

            SQLiteConnection connection = PlumbingDatabaseManager.OpenSqliteConnection(dbPath);

            connection.Open();
            using (SQLiteTransaction sqlTr = connection.BeginTransaction())
            {
                //P_NODE_EDIT.TestingFunction.testing1(ConstantName.TEMPPATH);
                ReadPNote.ReadDataPNode(connection);
                sqlTr.Commit();
                connection.Close();
            }

            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
コード例 #2
0
        public static NODEDWG SetUp(string currentDWGPath)
        {
            string  databasePath = GoodiesPath.GetDatabasePathFromDwgPath(currentDWGPath);
            NODEDWG node;

            if (string.IsNullOrEmpty(databasePath))
            {
                SQLiteConnection connection = PlumbingDatabaseManager.OpenSqliteConnection(databasePath);
                node = ReadPNote.ReadDataPNode(connection);
            }
            else
            {
                while (string.IsNullOrEmpty(databasePath))
                {
                    databasePath = GoodiesPath.GetDatabasePathFromDwgPath(currentDWGPath);
                    MessageBox.Show("This file is not path of any project.", "Project Not Found", MessageBoxButtons.OK);

                    ProgramManagerForm form = new ProgramManagerForm("");
                    form.Show();
                }

                SQLiteConnection connection = PlumbingDatabaseManager.OpenSqliteConnection(databasePath);
                node = ReadPNote.ReadDataPNode(connection);
            }
            return(node);
        }
コード例 #3
0
ファイル: Main.cs プロジェクト: dngo10/GOUVIS_PLUMBING_PLUGIN
        public void RunTest3()
        {
            string dwgPath = Application.DocumentManager.MdiActiveDocument.Name;
            string dbPath  = GoodiesPath.GetDatabasePathFromDwgPath(dwgPath);

            if (string.IsNullOrEmpty(dbPath))
            {
                MessageBox.Show("Couldn't find the database!");
                return;
            }

            SQLiteConnection connection = PlumbingDatabaseManager.OpenSqliteConnection(dbPath);

            connection.Open();
            using (SQLiteTransaction sqlTr = connection.BeginTransaction())
            {
                WritePNote.WriteScheduleTableToNote(connection);
                sqlTr.Commit();
                connection.Close();
            }
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }