Пример #1
0
    public static TStreet Seek(Connection conn, int uclp, int street)
    {
        TStreet alias = new TStreet();

        alias.uclp   = uclp;
        alias.street = street;
        alias.Get(conn, null);
        return(alias);
    }
Пример #2
0
    public override string GetFullText(Connection conn)
    {
        TUCLP uclp = TUCLP.Seek(conn, this.uclp);
        //string filtered = FilterPrefixes(uclp.name, UclpPrefixes);
        TArea         area     = TArea.Seek(uclp.area);
        TRegion       region   = TRegion.Seek(uclp.area, uclp.region);
        StringBuilder fullText = new StringBuilder();

        //if (area.name != filtered || region.name != filtered)
        fullText.AppendFormat("Област {0}, Община {1}, ", area.name, region.name);

        fullText.Append(uclp.name);

        if (street != 0)
        {
            fullText.AppendFormat(", {0}", TStreet.Seek(conn, this.uclp, street).name);
        }

        AddressPart[] parts = new AddressPart[]
        {
            new AddressPart("No ", adrNo),
            new AddressPart("Блок ", blockNo),
            new AddressPart("Подн.", subNo),
            new AddressPart("Вх.", entrance),
            new AddressPart("Ет.", floor),
            new AddressPart("Ап.", apartment)
        };

        foreach (AddressPart part in parts)
        {
            if (part.text != "")
            {
                fullText.AppendFormat(", {0}{1}", part.prefix, part.text);
            }
        }

        return(fullText.ToString());
    }