public ReceivedBatch FindReceivedBatchById(int id) { ITransaction finder = new FindBatchInReceivingLedgerByIdTransaction(id, sqliteStore); finder.Execute(); Entity <ReceivedBatch> entity = finder.Results[0] as Entity <ReceivedBatch>; return(entity.NativeModel); }
public void UpdateReceivedBatch(int id, ReceivedBatch batch) { ITransaction finder = new FindBatchInReceivingLedgerByIdTransaction(id, sqliteStore); finder.Execute(); if (finder.Results.Count > 0) { Entity <ReceivedBatch> originalEntity = finder.Results[0] as Entity <ReceivedBatch>; Entity <ReceivedBatch> updatedEntity = CreateUpdatedEntityFromOriginal(originalEntity, batch); ITransaction updater = new EditBatchInReceivingLedgerTransaction(updatedEntity, sqliteStore); UpdateInventoryBatches(originalEntity, updatedEntity); UpdateImplementedBatches(originalEntity, updatedEntity); updater.Execute(); } }