Example #1
0
        public ResolveRating BuildingValidate(ObjGeo geo)
        {
            ResolveRating ret = ResolveRating.BldNomatch;

            if (this.IsEmpty)
            {
                return(ret);
            }

            if (false == string.IsNullOrEmpty(this.Block))
            {
                ret = (BuildingShapeValidate(geo, string.Format("{0}/{1}", this.Building, this.Block)) ||
                       BuildingShapeValidate(geo, string.Format("{0}к{1}", this.Building, this.Block)) ||
                       BuildingShapeValidate(geo, string.Format("{0}стр{1}", this.Building, this.Block)) ||
                       BuildingShapeValidate(geo, string.Format("{0}{1}", this.Building, this.Block)))
                    ? ResolveRating.Clear : ret;

                if (ret == ResolveRating.BldNomatch)
                {
                    ret = BuildingShapeValidate(geo, this.Building) ? ResolveRating.BldExcess : ret;
                }
            }
            else
            {
                ret = BuildingShapeValidate(geo, this.Building) ? ResolveRating.Clear : ret;
            }

            return(ret);
        }
Example #2
0
        public ResolveRating BuildingValidate(ObjGeo geo)
        {
            ResolveRating ret = ResolveRating.BldNomatch;

            if (this.IsEmpty)
                return ret;

            if (false == string.IsNullOrEmpty(this.Block))
            {
                ret = (BuildingShapeValidate(geo, string.Format("{0}/{1}", this.Building, this.Block))
                    || BuildingShapeValidate(geo, string.Format("{0}к{1}", this.Building, this.Block))
                    || BuildingShapeValidate(geo, string.Format("{0}стр{1}", this.Building, this.Block))
                    || BuildingShapeValidate(geo, string.Format("{0}{1}", this.Building, this.Block)))
                    ? ResolveRating.Clear : ret;

                if (ret == ResolveRating.BldNomatch)
                    ret = BuildingShapeValidate(geo, this.Building) ? ResolveRating.BldExcess : ret;
            }
            else
            {
                ret = BuildingShapeValidate(geo, this.Building) ? ResolveRating.Clear : ret;
            }

            return ret;
        }
Example #3
0
        private bool BuildingShapeValidate(ObjGeo geo, string shape)
        {
            if (geo.BuildingValidate(shape))
            {
                //this.Building = shape;
                return(true);
            }

            return(false);
        }
Example #4
0
        public override bool Equals(object obj)
        {
            ObjGeo geo = obj as ObjGeo;

            if (geo != null)
            {
                return(((ObjGeo)obj).OriginalCode.Equals(this.OriginalCode));
            }

            return(false);
        }
Example #5
0
        internal static ResolveRating EnsureParentChildConsistency(ObjGeo parent, ObjGeo child)
        {
            if (parent.Level >= child.Level)
                throw new ArgumentOutOfRangeException("parent.Level >= child.Level");

            ResolveRating ret = ResolveRating.Clear;
            string childCode = child.Level.CodeTrim(child.Code);

            if (childCode.StartsWith((child.Level - 1).CodeTrim(parent.Code)))
                return ret;

            if (childCode.StartsWith(parent.Level.CodeTrim(parent.Code)))
            {
                ret |= ResolveRating.Shortage;
                return ret;
            }

            if (parent.Level.CodePart(child.Code).All(ch => ch == '0'))
                ret |= ResolveRating.Excess;
            else
                ret |= ResolveRating.NoMatch;

            return ret;
        }
Example #6
0
        private bool BuildingShapeValidate(ObjGeo geo, string shape)
        {
            if (geo.BuildingValidate(shape))
            {
                //this.Building = shape;
                return true;
            }

            return false;
        }