コード例 #1
0
            public ChileLot CreateUnserializedChileLot(LotDTO oldLot, Lot newLot, ChileProduct chileProduct, IEnumerable <AttributeName> attributeNames, out List <LotAttributeDefect> lotAttributeDefects)
            {
                var attributeCommonData = new AttributeCommonData(oldLot, LotMother);

                newLot.Attributes = new List <LotAttribute>();
                foreach (var attribute in StaticAttributeNames.AttributeNames)
                {
                    var newAttribute = newLot.AddNewAttribute(oldLot, attribute, attributeCommonData, LotMother);
                    if (newAttribute != null)
                    {
                        var wrapper = new ILotAttributesExtensions.LotAttributeWrapper(oldLot, oldLot.OriginalHistory, attribute);
                        newAttribute.Computed = wrapper.Computed;
                    }
                }

                return(CreateChileLotAndDefects(oldLot, newLot, chileProduct, attributeNames, out lotAttributeDefects));
            }
コード例 #2
0
            private void AddNewLotAttribute(ILotAttributes oldAttributes, Lot newLot, ChileProductAttributeRange range, AttributeName attributeName, AttributeCommonData attributeData, double value, ref List <LotAttributeDefect> lotAttributeDefects)
            {
                var attribute = newLot.AddNewAttribute(oldAttributes, attributeName, attributeData, LotMother);

                if (attribute == null)
                {
                    return;
                }

                if (range.ValueOutOfRange(attribute.AttributeValue))
                {
                    LotMother.AddRead(EntityTypes.LotDefect);
                    LotMother.AddRead(EntityTypes.LotAttributeDefect);

                    CreateOrUpdateOpenAttributeDefect(newLot, attributeName, value, range, ref lotAttributeDefects);
                }
                else
                {
                    CloseOpenAttributeDefects(attribute, lotAttributeDefects);
                }
            }