Esempio n. 1
0
        private void readPowierzchniaDataFromDB(Powierzchnia pow)
        {
            string query = "";

            ModelPunkty points = new ModelPunkty();

            query            = SqlQueries.getPoints + pow.idPow;
            points.pointData = reader.readFromDBToDataTable(query);
            pow.points       = points;

            ModelTriangles triangles = new ModelTriangles();

            query = SqlQueries.getTriangles + pow.idPow;
            triangles.triangleData = reader.readFromDBToDataTable(query);
            pow.triangles          = triangles;

            ModelLinie breaklines = new ModelLinie();

            query = SqlQueries.getBreaklines + pow.idPow;
            breaklines.breaklineData = reader.readFromDBToDataTable(query);
            pow.breaklines           = breaklines;

            ModelGrid grids = new ModelGrid();

            query          = SqlQueries.getGrids + pow.idPow;
            grids.gridData = reader.readFromDBToDataTable(query);
            pow.grids      = grids;
        }
Esempio n. 2
0
        private void writePowierzchniaDataToDB(Powierzchnia pow)
        {
            string tableName = "";
            uint   newIdPow  = uint.Parse(pow.idPow.ToString());

            tableName = dbConnector.getTableNameFromQuery(SqlQueries.getPoints);
            ModelPunkty points = pow.points;

            if (points.setNewIdPow(newIdPow))
            {
                writer.writeBulkDataToDB(points.pointData, tableName);
            }

            tableName = dbConnector.getTableNameFromQuery(SqlQueries.getTriangles);
            ModelTriangles triangles = pow.triangles;

            if (triangles.setNewIdPow(newIdPow))
            {
                writer.writeBulkDataToDB(triangles.triangleData, tableName);
            }

            tableName = dbConnector.getTableNameFromQuery(SqlQueries.getGrids);
            ModelGrid grids = pow.grids;

            if (grids.setNewIdPow(newIdPow))
            {
                writer.writeBulkDataToDB(grids.gridData, tableName);
            }

            tableName = dbConnector.getTableNameFromQuery(SqlQueries.getBreaklines);
            ModelLinie breaklines = pow.breaklines;

            if (breaklines.setNewIdPow(newIdPow))
            {
                writer.writeBulkDataToDB(breaklines.breaklineData, tableName);
            }
        }