private static FixtureUnitModel getItem(SQLiteDataReader reader, SQLiteConnection connection) { FixtureUnitModel model = new FixtureUnitModel(); long POSITION_ID = (long)reader[DBFixtureUnitName.POSITION_ID]; long TRANSFORM_ID = (long)reader[DBFixtureUnitName.MATRIX_ID]; model.handle = (string)reader[DBFixtureUnitName.HANDLE]; model.INDEX = (double)reader[DBFixtureUnitName.INDEX]; model.TAG = (string)reader[DBFixtureUnitName.TAG]; model.NUMBER = (string)reader[DBFixtureUnitName.NUMBER]; model.CW_DIA = (double)reader[DBFixtureUnitName.CW_DIA]; model.HW_DIA = (double)reader[DBFixtureUnitName.HW_DIA]; model.WASTE_DIA = (double)reader[DBFixtureUnitName.WASTE_DIA]; model.VENT_DIA = (double)reader[DBFixtureUnitName.VENT_DIA]; model.STORM_DIA = (double)reader[DBFixtureUnitName.STORM_DIA]; model.WSFU = (double)reader[DBFixtureUnitName.WSFU]; model.CWSFU = (double)reader[DBFixtureUnitName.CWSFU]; model.HWSFU = (double)reader[DBFixtureUnitName.HWSFU]; model.DFU = (double)reader[DBFixtureUnitName.DFU]; model.ID = (long)reader[DBFixtureUnitName.ID]; long FILE_ID = (long)reader[DBFixtureUnitName.FILE_ID]; model.A2 = (double)reader[DBFixtureUnitName.A2]; model.Y2 = (double)reader[DBFixtureUnitName.Y2]; model.X2 = (double)reader[DBFixtureUnitName.X2]; model.X2_2 = (double)reader[DBFixtureUnitName.X2_2]; model.A3 = (double)reader[DBFixtureUnitName.A3]; model.A1 = (double)reader[DBFixtureUnitName.A1]; model.D1 = (double)reader[DBFixtureUnitName.D1]; long tagID = (long)reader[DBFixtureUnitName.tagPos]; long ventID = (long)reader[DBFixtureUnitName.ventPos]; long hotStubID = (long)reader[DBFixtureUnitName.hotStub]; long coldStubID = (long)reader[DBFixtureUnitName.coldStub]; long drainPosID = (long)reader[DBFixtureUnitName.drainPos]; long M_ID = (long)reader[DBFixtureUnitName.M_ID]; long R1_ID = (long)reader[DBFixtureUnitName.R1_ID]; long V_ID = (long)reader[DBFixtureUnitName.V_ID]; model.matrixTransform = DBMatrix3d.SelectRow(connection, TRANSFORM_ID); model.position = DBPoint3D.SelectRow(connection, POSITION_ID); model.file = DBDwgFile.SelectRow(connection, FILE_ID); model.tagPos = DBPoint3D.SelectRow(connection, tagID); model.ventPos = DBPoint3D.SelectRow(connection, ventID); model.hotStub = DBPoint3D.SelectRow(connection, hotStubID); model.coldStub = DBPoint3D.SelectRow(connection, coldStubID); model.drainPos = DBPoint3D.SelectRow(connection, drainPosID); model.M = DBPoint3D.SelectRow(connection, M_ID); model.R1 = DBPoint3D.SelectRow(connection, R1_ID); model.V = DBPoint3D.SelectRow(connection, V_ID); return(model); }
public void ReadFromDatabase(SQLiteConnection connection, long ID) { Point3dModel point3dM = DBPoint3D.SelectRow(connection, ID); if (point3dM != null) { X = point3dM.X; Y = point3dM.Y; Z = point3dM.Z; this.ID = point3dM.ID; } }
private static TableModel CreateModel(SQLiteDataReader reader, SQLiteConnection connection) { TableModel model = new TableModel(); model.ID = Convert.ToInt64(reader[DBTableName.ID]); model.handle = Convert.ToString(reader[DBTableName.HANDLE]); model.matrixTransform = DBMatrix3d.SelectRow(connection, Convert.ToInt64(reader[DBTableName.MATRIX_ID])); model.position = DBPoint3D.SelectRow(connection, Convert.ToInt64(reader[DBTableName.POSITION_ID])); model.ALIAS = Convert.ToString(reader[DBTableName.ALIAS]); model.A_VALUE = Convert.ToString(reader[DBTableName.A_VALUE]); model.file = DBDwgFile.SelectRow(connection, Convert.ToInt64(reader[DBTableName.FILE_ID])); return(model); }
private static AreaBorderModel GetModelFromReader(SQLiteDataReader reader, SQLiteConnection connection) { AreaBorderModel model = new AreaBorderModel(); model.ID = (long)reader[DBAreaBorderNames.ID]; model.handle = (string)reader[DBAreaBorderNames.HANDLE]; model.position = DBPoint3D.SelectRow(connection, (long)reader[DBAreaBorderNames.POSITION_ID]); model.pointTop = DBPoint3D.SelectRow(connection, (long)reader[DBAreaBorderNames.POINT_TOP_ID]); model.pointBottom = DBPoint3D.SelectRow(connection, (long)reader[DBAreaBorderNames.POINT_BOTTOM_ID]); model.origin = DBPoint3D.SelectRow(connection, (long)reader[DBAreaBorderNames.ORIGIN_ID]); model.matrixTransform = DBMatrix3d.SelectRow(connection, (long)reader[DBAreaBorderNames.MATRIX_ID]); model.X = (double)reader[DBAreaBorderNames.X]; model.Y = (double)reader[DBAreaBorderNames.Y]; model.file = DBDwgFile.SelectRow(connection, (long)reader[DBAreaBorderNames.FILE_ID]); if (model.ID == ConstantName.invalidNum) { model = null; } return(model); }