Basic case working. Edit existing lines, create otherwise.
Lines ordered by ItemId