Ejemplo n.º 1
0
        public void WriteToDatabase(SQLiteConnection connection)
        {
            var temp = this;

            WriteToDatabase0(connection);

            origin.WriteToDatabase(connection);
            pointBottom.WriteToDatabase(connection);
            pointTop.WriteToDatabase(connection);

            if (!DBAreaBorder.HasRow(connection, handle, file.ID))
            {
                WriteToDatabase0(connection);
                origin.ID      = DBPoint3D.InsertRow(ref origin, connection);
                pointTop.ID    = DBPoint3D.InsertRow(ref pointTop, connection);
                pointBottom.ID = DBPoint3D.InsertRow(ref pointBottom, connection);
            }
            else
            {
                AreaBorderModel model = DBAreaBorder.SelectRow(connection, handle, file.ID);
                ID = model.ID;

                UpdateToDatabase0(model.matrixTransform.ID, model.position.ID, connection);

                origin.ID      = model.ID;
                pointTop.ID    = model.ID;
                pointBottom.ID = model.ID;

                DBPoint3D.UpdateRow(origin, connection);
                DBPoint3D.UpdateRow(pointTop, connection);
                DBPoint3D.UpdateRow(pointBottom, connection);

                DBAreaBorder.UpdateRow(connection, this);
            }
        }
        /// <summary>
        /// Get ID from database FROM DATABASE, just to get ID.
        /// </summary>
        /// <param name="matrix"></param>
        /// <param name="position"></param>
        /// <param name="connection"></param>
        protected virtual void UpdateToDatabase0(long DBMatrixID, long DBPositionID, SQLiteConnection connection)
        {
            this.position.ID        = DBMatrixID;
            this.matrixTransform.ID = DBPositionID;

            DBPoint3D.UpdateRow(position, connection);
            DBMatrix3d.Update(connection, matrixTransform);
        }
Ejemplo n.º 3
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.º 4
0
 public void WriteToDatabase(SQLiteConnection connection)
 {
     if (!DBPoint3D.HasRow(connection, ID))
     {
         var temp = this;
         ID = DBPoint3D.InsertRow(ref temp, connection);
     }
     else
     {
         DBPoint3D.UpdateRow(this, connection);
     }
 }