public void StreamIn(RStrmIn reader)
        {
            while (reader.MoveNext())
            {
                int propertyId = reader.GetPropertyId(ModelSchema.BridgeAssignmentEstItemKeywordArray);
                if (propertyId == -1)
                {
                    propertyId = reader.GetPropertyId(ModelSchema.BridgeAssignmentEstItemKeywordArrayOld);
                }

                switch (propertyId)
                {
                case (int)BridgeAssignEstItemProperty.Id:
                    EstItemId = reader.ReadString();
                    break;

                case (int)BridgeAssignEstItemProperty.Qty:
                    QuantityGenerated = reader.ReadDouble();
                    break;

                case (int)BridgeAssignEstItemProperty.Asn:
                    var obj = new VariableAssignmentSummary();
                    obj.StreamIn(reader);
                    VariableAssignmentList.Add(obj);
                    break;
                }
            }
        }
        public void StreamIn(RStrmIn reader)
        {
            while (reader.MoveNext())
            {
                int propertyId = reader.GetPropertyId(ModelSchema.BridgeAssignmentResourceKeywordArray);
                if (propertyId == -1)
                {
                    propertyId = reader.GetPropertyId(ModelSchema.BridgeAssignmentResourceKeywordArrayOld);
                }

                switch (propertyId)
                {
                case (int)BridgeAssignResourceProperty.Id:
                {
                    ResourceId = reader.ReadString();
                    break;
                }

                case (int)BridgeAssignResourceProperty.Typ:
                {
                    var input = reader.ReadString()[0];
                    if (input == 'I')
                    {
                        ResourceType = ResourceType.Item;
                    }
                    if (input == 'A')
                    {
                        ResourceType = ResourceType.Assembly;
                    }
                    if (input == 'S')
                    {
                        ResourceType = ResourceType.ETakeoffBridgeAssembly;
                    }

                    break;
                }

                case (int)BridgeAssignResourceProperty.Desc:
                {
                    Description = reader.ReadString();
                    break;
                }
                }
            }
        }
        public void StreamIn(RStrmIn reader)
        {
            while (reader.MoveNext())
            {
                int propertyId = reader.GetPropertyId(ModelSchema.VariableAssignmentKeywordArray);
                if (propertyId == -1)
                {
                    propertyId = reader.GetPropertyId(ModelSchema.VariableAssignmentKeywordArrayOld);
                }

                switch (propertyId)
                {
                case (int)BridgeAssignVariableAssignProperty.Tko:
                    FromTakeoffNumber = reader.ReadInteger();
                    break;

                case (int)BridgeAssignVariableAssignProperty.FVar:
                    FromVariableName = reader.ReadString();
                    break;

                case (int)BridgeAssignVariableAssignProperty.TVar:
                    ToVariableName = reader.ReadString();
                    break;

                case (int)BridgeAssignVariableAssignProperty.Val:
                    VariableValue = reader.ReadString();
                    break;

                case (int)BridgeAssignVariableAssignProperty.FOVal:
                    FromOverflowValue = reader.ReadString();
                    break;

                case (int)BridgeAssignVariableAssignProperty.HasFV:
                    reader.ReadBoolean();
                    break;

                case (int)BridgeAssignVariableAssignProperty.MTko:
                    MissingTkoVariable = reader.ReadBoolean();
                    break;
                }
            }
        }
        public void StreamIn(RStrmIn reader)
        {
            while (reader.MoveNext())
            {
                int propertyId = reader.GetPropertyId(ModelSchema.BridgeAssignmentTakeoffObjectKeywordArray);
                if (propertyId == -1)
                {
                    propertyId = reader.GetPropertyId(ModelSchema.BridgeAssignmentTakeoffObjectKeywordArrayOld);
                }

                switch (propertyId)
                {
                case (int)BridgeAssignTakeoffProperty.SId:
                    TkoSystemId = reader.ReadString();
                    break;

                case (int)BridgeAssignTakeoffProperty.Proj:
                    TkoProjectId = reader.ReadString();
                    break;

                case (int)BridgeAssignTakeoffProperty.Id:
                    TkoId = reader.ReadString();
                    break;

                case (int)BridgeAssignTakeoffProperty.Typ:
                    TkoTypeId = reader.ReadString();
                    break;

                case (int)BridgeAssignTakeoffProperty.RfId:
                    TkoRefId = reader.ReadInteger();
                    break;

                case (int)BridgeAssignTakeoffProperty.Desc:
                    Description = reader.ReadString();
                    break;
                }
            }
        }
        public void StreamIn(RStrmIn reader)
        {
            while (reader.MoveNext())
            {
                int propertyId = reader.GetPropertyId(ModelSchema.BridgeAssignmentPassKeywordArray);
                if (propertyId == -1)
                {
                    propertyId = reader.GetPropertyId(ModelSchema.BridgeAssignmentPassKeywordArrayOld);
                }

                switch (propertyId)
                {
                case (int)BridgeAssignPassProperty.PTko:
                    PrimaryTakeoffNumber = reader.ReadInteger();
                    break;

                case (int)BridgeAssignPassProperty.Asn:
                    var obj = new VariableAssignmentSummary();
                    obj.StreamIn(reader);
                    VariableAssignmentList.Add(obj);
                    break;
                }
            }
        }
        public void StreamIn(RStrmIn reader)
        {
            while (reader.MoveNext())
            {
                int propertyId = reader.GetPropertyId(ModelSchema.BridgeAssignmentKeywordArray);
                if (propertyId == -1)
                {
                    propertyId = reader.GetPropertyId(ModelSchema.BridgeAssignmentKeywordArrayOld);
                }

                switch (propertyId)
                {
                case (int)BridgeAssignmentProperty.Tko:
                {
                    var obj = new BridgeAssignmentTakeoffObjectSummary();
                    obj.StreamIn(reader);
                    TakeoffObjectCollection.Add(obj);
                    break;
                }

                case (int)BridgeAssignmentProperty.Res:
                {
                    var obj = new BridgeAssignmentResourceSummary();
                    obj.StreamIn(reader);
                    ResourceCollection.Add(obj);
                    break;
                }

                case (int)BridgeAssignmentProperty.Pass:
                {
                    var obj = new BridgeAssignmentPassSummary();
                    obj.StreamIn(reader);
                    AssignmentPassCollection.Add(obj);
                    break;
                }

                case (int)BridgeAssignmentProperty.Item:
                {
                    var obj = new BridgeAssignmentEstItemSummary();
                    obj.StreamIn(reader);
                    ItemDetailCollection.Add(obj);
                    break;
                }

                case (int)BridgeAssignmentProperty.AsnId:
                    AssignmentId = reader.ReadString();
                    break;
                }
            }

            foreach (var obj in AssignmentPassCollection)
            {
                if (obj.PrimaryTakeoffNumber >= 0)
                {
                    var takeoffItem =
                        TakeoffObjectCollection.FirstOrDefault(tko => tko.TkoRefId == obj.PrimaryTakeoffNumber);
                    if (takeoffItem != null)
                    {
                        takeoffItem.TkoRefId = obj.PrimaryTakeoffNumber;
                        obj.PrimaryTakeoffObjectCollection.Add(takeoffItem);
                    }
                }
            }
        }