Esempio n. 1
0
    protected string GetContactDetail(DataRow[] rows)
    {
        string output = string.Empty;

        for (int i = 0; i < rows.Length; i++)
        {
            ContactAus contact = ContactAusDB.LoadAll(rows[i]);

            bool isAddress = contact.ContactType.ContactTypeGroup.ID == 1;
            bool isPhone   = contact.ContactType.ContactTypeGroup.ID == 2;
            bool isBedroom = contact.ContactType.ContactTypeGroup.ID == 3;

            bool isEmail   = contact.ContactType.ContactTypeID == 27;
            bool isWebsite = contact.ContactType.ContactTypeID == 28;


            if (isAddress)
            {
                output += @"<tr><td style=""min-width:140px"">" + contact.ContactType.Descr + @"</td><td style=""min-width:10px;""></td><td>" + contact.GetFormattedAddress() + "<br>" + "</td></tr>";
            }
            else if (isPhone)
            {
                output += @"<tr><td style=""min-width:140px"">" + contact.ContactType.Descr + @"</td><td style=""min-width:10px;""></td><td>" + contact.GetFormattedPhoneNumber() + "</td></tr>";
            }
            else if (isEmail)
            {
                output += @"<tr><td style=""min-width:140px"">" + contact.ContactType.Descr + @"</td><td style=""min-width:10px;""></td><td>" + contact.AddrLine1 + "</td></tr>";
            }
        }

        return(output);
    }
    protected void CreateTable(PlaceHolder placeHolder, DataRow[] rows, int width, int height)
    {
        placeHolder.Controls.Clear();
        Table t = new Table();

        placeHolder.Controls.Add(t);
        for (int i = 0; i < rows.Length; i++)
        {
            ContactAus contact = ContactAusDB.LoadAll(rows[i]);
            if (contact.FreeText.Trim().Length > 0)
            {
                t.Rows.Add(CreateNewRow(contact, width, height, true, true));
                t.Rows.Add(CreateNewRow(contact, width, height, true, false));
            }
            else
            {
                t.Rows.Add(CreateNewRow(contact, width, height, false, false));
            }
        }
    }