May 29, 2018, 4:41 AM
Please help me ASP.Net MVC add item to store in controller
I have DirectEvent
public ActionResult AddItemToDetails(long lookupItemId, String viewBagID, int posLinesCount)
{
var itemRepository = new ItemRepository();
var item = itemRepository.Get(c => c.Id == lookupItemId, new []{ "BaseUom" }).SingleOrDefault();
Store posLineStore = X.GetCmp<Store>("posLineStore" + viewBagID);
int lineNo = posLinesCount <= 0 ? 1 : posLinesCount + 1;
var newItem = new PosLineEditViewModel() { ItemId = item.Id, Description = item.Description, LineNo = lineNo, Quantity = 1, UnitPrice = 1, Amount = 1, UomId = item.BaseUomId, UomDescription = item.BaseUom.Description, Id = 2};
posLineStore.Add(newItem);
return this.Direct();
}
Here is my error
Uncaught TypeError: Cannot read property 'add' of undefined
at eval (eval at executeScriptDelay ...
at eval (eval at executeScriptDelay ...
Last edited by anh34; May 29, 2018 at 5:20 AM.