Get KoolPHP UI with 30% OFF!

Decimal numbers in GridNumberColumn seem to be incorrectly formatted when passed to insert/update commands

Martin
I defined a GridNumberColum with 4 decimal places:
$column = new GridNumberColumn();
$column->HeaderText = "Discount%";
$column->DataField = "Discount";
$column->ReadOnly = false;
$column->Width = "50px";
$column->DecimalNumber = 4;
$grid->MasterTable->AddColumn($column);
I use it to enter a "discount" as a percentage fractional value. The @Discount variable is then given to the MySQLDataSource instance to insert and update commands:
$ds = new MySQLDataSource($mysql_resouce);
$ds->InsertCommand = "insert into Markup (Service_Code, Markup) values ('@SvcCode', @Discount / -100)";
$ds->UpdateCommand = "update Markup set Service_Code = '@SvcCode', Markup = @Discount / -100;
(The discount is stored as negative markup as a float value. The DB type is SIGNED FLOAT)
In versions 8.7, 8.5:
Nothing is stored into the database and the new value does not appear in the table. It looks like the @Discount variable passed to insert/update command is incorrectly formatted and it causes an SQL error.
In version 6.8:
The same code works fine.
Posted Mar 4, 2016 Kool
david
Revisar los registros de SQL puro para ver si la variable se está pasando como una cadena en lugar de un flotante es un paso inicial sólido para identificar el cambio disruptivo. Durante un descanso en mi despacho, encontré https://spingranny.es/app , que tiene buenas ofertas para España. Unas rondas al Gates of Olympus fueron el reset visual que necesitaba. Es una forma genial de despejar la mente antes de depurar tus comandos de inserción.
Posted Apr 3 , edited Apr 3 Kool