Ejemplo n.º 1
0
 public static void CreateTable(SQLiteConnection connection)
 {
     using (SQLiteCommand command = connection.CreateCommand())
     {
         DBTableCommands.CreateTable(command);
         command.ExecuteNonQuery();
     }
 }
Ejemplo n.º 2
0
 public static void UpdateRow(SQLiteConnection connection, TableModel model)
 {
     using (SQLiteCommand command = connection.CreateCommand())
     {
         DBTableCommands.UpdateRow(command, model);
         long check = command.ExecuteNonQuery();
         DBPoint3D.UpdateRow(model.position, connection);
         DBMatrix3d.Update(connection, model.matrixTransform);
     }
 }
Ejemplo n.º 3
0
 public static long InsertRow(SQLiteConnection connection, TableModel model)
 {
     using (SQLiteCommand command = connection.CreateCommand())
     {
         DBTableCommands.InsertRow(command, model);
         long check = command.ExecuteNonQuery();
         if (check == 1)
         {
             model.ID = connection.LastInsertRowId;
             return(model.ID);
         }
         else if (check == 0)
         {
             throw new Exception("DBTable -> InsertRow -> Can't insert.");
         }
         throw new Exception("DBTable -> InsertRow -> Failed to Insert.");
     }
 }