/// <summary> /// Create table DBPoint3d Table /// </summary> /// <param name="connection"></param> public static void CreateTable(SQLiteConnection connection) { using (SQLiteCommand command = connection.CreateCommand()) { DBPoint3DCommands.CreateTable(command); command.ExecuteNonQuery(); } }
public static long UpdateRow(Point3dModel model, SQLiteConnection connection) { using (SQLiteCommand command = connection.CreateCommand()) { DBPoint3DCommands.Update(command, model); int check = command.ExecuteNonQuery(); return(check); } }
/// <summary> /// Insert a point to Table, return id the row inserted. /// After inserting, ID will be added to model /// </summary> /// <param name="point"></param> /// <param name="connection"></param> /// <returns></returns> public static long InsertRow(ref Point3dModel model, SQLiteConnection connection) { using (SQLiteCommand command = connection.CreateCommand()) { DBPoint3DCommands.Insert(command, model); int check = command.ExecuteNonQuery(); if (check == 1) { model.ID = connection.LastInsertRowId; return(model.ID); } else if (check == 0) { throw new Exception("DBPoint3dCommands -> Insert -> No Point Was Inserted"); } throw new Exception("DBPoint3D -> Insert -> Insert Point not successful."); } }