private void AddLineItem(Command command) { var cmd = command as AddMcaLineItemsCommand; ValidateCommand(cmd); if (cmd != null) { foreach (var item in cmd.ResultDetail) { var presidentalLineItem = new McaResultLineItem() { Id = Guid.NewGuid(), Candidate = item.Candidate, ResultCount = item.Result, ModifiedCount = 0, ReceivedTime = DateTime.Now }; LineItems.Add(presidentalLineItem); } } }
private void Modify(Command command) { //todo Review modify lineitems method var cmd = command as ModifyMcaResultsCommand; ValidateCommand(cmd); if (cmd != null) { foreach (var item in cmd.ResultDetail) { var presidentalLineItem = new McaResultLineItem() { Id = Guid.NewGuid(), Candidate = item.Candidate, ResultCount = item.Result, ModifiedCount = LineItems.Max(z => z.ModifiedCount) + 1, ReceivedTime = DateTime.Now }; LineItems.Add(presidentalLineItem); } } Status = ResultStatus.Modified; }