示例#1
0
    public static UCLP Seek(Connection conn, int uclp)
    {
        UCLP alias = new UCLP();

        alias.uclp = uclp;
        alias.Get(conn, null);
        return(alias);
    }
示例#2
0
    public override string GetFullText(Connection conn)
    {
        UCLP uclp = UCLP.Seek(conn, this.uclp);
        //string filtered = FilterPrefixes(uclp.name, UclpPrefixes);
        Area          area     = Area.Seek(uclp.area);
        Region        region   = Region.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}", Street.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());
    }