/// <summary> /// Shallow copy. /// </summary> public ProtocolResult ConvertFromArchived(ArchivedProtocolResult aProtocolResult) { var protocolResult = new ProtocolResult(); protocolResult.ResultNumber = aProtocolResult.ResultNumber; protocolResult.Results = aProtocolResult.Results; var converter = new ProductTestsConverter(); protocolResult.ProductTest = converter.ConvertFromArchived(aProtocolResult.ArchivedProductTest); return(protocolResult); }
/// <summary> /// Shallow copy ! /// </summary> public ProtocolResult ConvertFromArchived(ArchivedProtocolResult aProtocolResult) { var protocolResult = new ProtocolResult(); protocolResult.ResultNumber = aProtocolResult.ResultNumber; protocolResult.Results = aProtocolResult.Results; //protocolResult.MethodValue = aProtocolResult.MethodValue; var converter = new ProductTestsConverter(); protocolResult.ProductTest = converter.ConvertFromArchived(aProtocolResult.ArchivedProductTest); return protocolResult; }
public Product ConvertFromArchived(ArchivedProduct aproduct) { var product = new Product(); product.Number = aproduct.Number; product.Name = aproduct.Name; product.Quantity = aproduct.Quantity; product.Diary = new Diary() { Number = aproduct.ArchivedDiary.Number }; //HACK!!! (like the rest is not but still..) product.ProductTests = new List <ProductTest>(); var converter = new ProductTestsConverter(); foreach (var item in aproduct.ArchivedProductTests) { var ptest = converter.ConvertFromArchived(item); ptest.Product = product; product.ProductTests.Add(ptest); } return(product); }