public void Update(FittingPreset preset)
 {
     Db.Query().CommandText("update robotfittingpresets set preset = @preset where id = @id")
     .SetParameter("@id", preset.Id)
     .SetParameter("@preset", preset.ToGenxyString())
     .ExecuteNonQuery().ThrowIfEqual(0, ErrorCodes.SQLUpdateError);
 }
 public virtual void Insert(FittingPreset preset)
 {
     preset.Id = Db.Query().CommandText("insert into robotfittingpresets (ownerEid,preset) values (@ownerEid,@preset);select cast(scope_identity() as int)")
                 .SetParameter("@ownerEid", preset.Owner)
                 .SetParameter("@preset", (string)preset.ToGenxyString())
                 .ExecuteScalar <int>().ThrowIfEqual(0, ErrorCodes.SQLInsertError);
 }