how to programatically increment the ordernumber
Posted: Mon Jan 16, 2012 1:21 pm
I'm inserting orders programatically from another system. When I set the order number:
It doesn't increment for the next order I insert. How can I increment it? I've tried:
and
But still each time, the ordernumber is the same.
Code: Select all
Order curOrder = new Order();
Store curStore = StoreDataSource.Load(1);
curOrder.OrderNumber = curStore.NextOrderId;
...
curOrder.Save();
Code: Select all
curStore.NextOrderId += 1;
curStore.Save();
curStore.OrderIdIncrement;
Code: Select all
curOrder.OrderNumber = StoreDataSource.GetNextOrderNumber();