public static void UpdateRow(SQLiteCommand command, DwgFileModel model) { string relPath = model.relativePath; List <List <object> > items = new List <List <object> >() { new List <object> { DBDwgFileName.RELATIVE_PATH, DBDwgFileName_AT.relPath, relPath }, new List <object> { DBDwgFileName.MODIFIEDDATE, DBDwgFileName_AT.modDate, model.modifieddate }, new List <object> { DBDwgFileName.ISP_NOTES, DBDwgFileName_AT.iNote, model.isP_Notes }, }; Dictionary <string, string> conDict = new Dictionary <string, string> { { DBDwgFileName.ID, DBDwgFileName_AT.id } }; Dictionary <string, string> variables = new Dictionary <string, string>(); Dictionary <string, object> paradict = new Dictionary <string, object>(); foreach (List <object> item in items) { variables.Add((string)item[0], (string)item[1]); paradict.Add((string)item[1], item[2]); } paradict.Add(DBDwgFileName.ID, model.ID); DBCommand.UpdateRow(DBDwgFileName.name, variables, conDict, paradict, command); command.ExecuteNonQuery(); }
//UPDATE POINT3D SET 'X' =1, 'Y' = 2, 'Z' = 3 WHERE ID = 3; public static void Update(SQLiteCommand command, Point3dModel model) { List <List <object> > itemList = new List <List <object> > { new List <object> { DBPoint3DName.X, DBPoint3D_AT.x, model.X }, new List <object> { DBPoint3DName.Y, DBPoint3D_AT.y, model.Y }, new List <object> { DBPoint3DName.Z, DBPoint3D_AT.z, model.Z } }; Dictionary <string, string> variable = new Dictionary <string, string>(); Dictionary <string, object> paraDict = new Dictionary <string, object>(); Dictionary <string, string> conDict = new Dictionary <string, string> { { DBPoint3DName.ID, DBPoint3D_AT.id } }; foreach (List <object> item in itemList) { variable.Add((string)item[0], (string)item[1]); paraDict.Add((string)item[1], item[2]); } ; paraDict.Add(DBPoint3D_AT.id, model.ID); DBCommand.UpdateRow(DBPoint3DName.tableName, variable, conDict, paraDict, command); }
public static void Update(SQLiteCommand command, Matrix3dModel model) { List <List <object> > items = getItems(model); Dictionary <string, string> conDict = new Dictionary <string, string> { { DBMatrixName.ID, DBMatrixName_AT.id } }; Dictionary <string, string> variables = new Dictionary <string, string>(); Dictionary <string, object> paraDict = new Dictionary <string, object>(); foreach (List <object> item in items) { variables.Add((string)item[0], (string)item[1]); paraDict.Add((string)item[1], item[2]); } paraDict.Add(DBMatrixName_AT.id, model.ID); DBCommand.UpdateRow(DBMatrixName.name, variables, conDict, paraDict, command); }
public static void UpdateRow(SQLiteCommand command, InsertPointModel model) { DBPoint3D.UpdateRow(model.position, command.Connection); DBMatrix3d.Update(command.Connection, model.matrixTransform); List <List <object> > items = GetItemsList(model); Dictionary <string, string> variables = new Dictionary <string, string>(); Dictionary <string, string> conditions = new Dictionary <string, string> { { DBInsertPointName.ID, DBInsertPointName_AT.id } }; Dictionary <string, object> paraDict = new Dictionary <string, object>(); foreach (List <object> item in items) { variables.Add((string)item[0], (string)item[1]); paraDict.Add((string)item[1], item[2]); } paraDict.Add(DBBlockName_AT.id, model.ID); DBCommand.UpdateRow(DBInsertPointName.name, variables, conditions, paraDict, command); }
public static void UpdateRow(FixtureDetailsModel model, SQLiteCommand command) { DBPoint3D.UpdateRow(model.position, command.Connection); DBMatrix3d.Update(command.Connection, model.matrixTransform); List <List <object> > items = getListItems(model); Dictionary <string, string> variables = new Dictionary <string, string>(); Dictionary <string, string> conDict = new Dictionary <string, string> { { DBFixtureDetailsNames.ID, DBFixtureDetailsNames_AT.id } }; Dictionary <string, object> paraDict = new Dictionary <string, object>(); foreach (List <object> item in items) { variables.Add((string)item[0], (string)item[1]); paraDict.Add((string)item[1], item[2]); } paraDict.Add(DBFixtureDetailsNames_AT.id, model.ID); DBCommand.UpdateRow(DBFixtureDetailsNames.name, variables, conDict, paraDict, command); }
public static void UpdateRow(SQLiteCommand command, FixtureBeingUsedAreaModel model) { DBPoint3D.UpdateRow(model.pointTop, command.Connection); DBPoint3D.UpdateRow(model.pointBottom, command.Connection); DBPoint3D.UpdateRow(model.origin, command.Connection); DBPoint3D.UpdateRow(model.position, command.Connection); DBMatrix3d.Update(command.Connection, model.matrixTransform); List <List <object> > items = GetItems(model); Dictionary <string, string> variables = new Dictionary <string, string>(); Dictionary <string, string> conDict = new Dictionary <string, string> { { DBFixtureBeingUsedAreaName.ID, DBFixtureBeingUsedAreaName_AT.id } }; Dictionary <string, object> paraDict = new Dictionary <string, object>(); foreach (List <object> item in items) { variables.Add((string)item[0], (string)item[1]); paraDict.Add((string)item[1], item[2]); } DBCommand.UpdateRow(DBFixtureBeingUsedAreaName.name, variables, conDict, paraDict, command); }