private AdditiveLot LoadAttributes(AdditiveLot newLot, LotDTO oldLot) { newLot.Lot.Attributes = new List <LotAttribute>(); var attributeData = new CreateChileLotHelper.AttributeCommonData(oldLot, this); foreach (var attributeName in StaticAttributeNames.AttributeNames) { var value = oldLot.AttributeGet(attributeName)(); if (value != null) { newLot.Lot.Attributes.Add(new LotAttribute { LotDateCreated = newLot.LotDateCreated, LotDateSequence = newLot.LotDateSequence, LotTypeId = newLot.LotTypeId, AttributeShortName = attributeName.ShortName, AttributeValue = (double)value, AttributeDate = attributeData.DeterminedTestDate, EmployeeId = attributeData.TesterId, TimeStamp = attributeData.EntryDate.Value, Computed = attributeData.NullTestDate }); } } return(newLot); }
internal static AdditiveLot SetLot(this AdditiveLot additiveLot, Lot lot) { if (additiveLot == null) { throw new ArgumentNullException("additiveLot"); } if (lot == null) { throw new ArgumentNullException("lot"); } additiveLot.SetLotKey(lot).Lot = lot; return(additiveLot); }
internal static AdditiveLot SetLotKey(this AdditiveLot additiveLot, ILotKey lotKey) { if (additiveLot == null) { throw new ArgumentNullException("additiveLot"); } if (lotKey == null) { throw new ArgumentNullException("lotKey"); } additiveLot.Lot = null; additiveLot.LotDateCreated = lotKey.LotKey_DateCreated; additiveLot.LotDateSequence = lotKey.LotKey_DateSequence; additiveLot.LotTypeId = lotKey.LotKey_LotTypeId; return(additiveLot); }