public IElectronicComponent Adapt(Z1ElectronicComponent component) { var result = new Models.ElectronicComponent(); if (component.Id != null) { result.Id = component.Id.ToString(); } result.Warehouse = WarehouseType.Z1; result.MPN = component.MPN; var(pn, lot, dateCode) = GetBarcodeVariables(component); result.PN = pn; result.Lot = lot; result.DateCode = dateCode; return(result); }
public IElectronicComponent Adapt(Z2ElectronicComponent component) { var result = new Models.ElectronicComponent { Id = component.Id.ToString(), Warehouse = WarehouseType.Z2, PN = component.PN, MPN = component.MPN }; if (component.Details != null) { result.DateCode = component.Details.DateCode; result.Lot = component.Details.Lot; } return(result); }