This topic is locked

Inventory Codd in after record added

2/11/2023 12:52:46 PM
ASPRunner.NET Tips and tricks
F
FAISAL A ALMAGHRABI author

I'm working on aspnunner.net v10.8
I wrote the code to update the repository as follows:
dynamic NewStock = null, StockData = XVar.Array(), StockUpdate = null, Stockdata = XVar.Array();
StockData = XVar.Clone(pageObject.getMasterRecord());
StockData["part_stock"];
if(values["mvt_type"] == "I")
{
NewStock = XVar.Clone(Stockdata["part_stock"] + values["mvt_qty"]);
}
else
{
NewStock = XVar.Clone(Stockdata["part_stock"] - values["mvt_qty"]);
}
StockUpdate = XVar.Clone(MVCFunctions.Concat("update stock set 'part_stock' =", NewStock, " where 'part_no' =", values["part_no"], ""));
CommonFunctions.db_exec((XVar)(StockUpdate), (XVar)(GlobalVars.conn));
return null;
When executing, an error is displayed as follows:

\ Inventory.csproj
Microsoft (R) Build Engine version 4.8.9037.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

include\stock_TableEvents.cs(28,18): error CS1002: ; expected [C:\Projects\Inventory\output\Inventory.csproj]
pls help me

admin 2/11/2023

You need to open file <output folder>\include\stock_TableEvents.cs in any text editor and see what is in the line 28. This is the line where compiler breaks.

F
FAISAL A ALMAGHRABI author 2/11/2023

I opened the file and the programming statement on line 28 is
StockData["part_stock"];
The correct error message is:

include\stock_TableEvents.cs(28,1): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement [C:\Projects\Inventory\output\Inventory.csproj]

admin 2/12/2023

Remove this line of code. It doesn't do anything and is meaningless. The rest of the code looks fine and should compile.