if (this.vehicletyp == 1 && this.VehicleCategorie == 1)
{
select VehicleTyp, VehicleCategorie from priceTable
where priceTable.VehicleTyp == this.VehicleTyp && priceTable.VehicleCategorie == this.VehicleCategorie;
if (priceTable.VehicleTyp == 1 && priceTable.VehicleCategorie == 1)
{
ret = checkFailed("Can't insert");
}
else
{
priceTable.VehicleTyp = this.VehicleTyp;
priceTable.VehicleCategorie = this.VehicleCategorie;
ret = true;
}
}
if (this.VehicleTyp == 2 && this.VehicleCategorie == 1)
{
select VehicleTyp, VehicleCategorie from priceTable
where priceTable.VehicleTyp == this.VehicleTyp && priceTable.VehicleCategorie == this.VehicleCategorie;
if (priceTable.VehicleTyp == 2 && priceTable.VehicleCategorie == 1)
{
ret = checkFailed("Can't insert");
}
else
{
priceTable.VehicleTyp = this.VehicleTyp;
priceTable.VehicleCategorie = this.VehicleCategorie;
ret = true;
}
}
it works so far.
Only Problem is that, when I click on the same record after I saved it, and want to save it again... it says "Can't insert"
Which I can understand... but are there any recommendations that You can give me to solve it ?
And do you have any other tips ?
Like do I Need a try catch Statement, Exception handling etc ??
Thanks in advance.