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);
            }
        }
Ejemplo n.º 2
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);
     }
 }