using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Activizr.Logic.Pirates;
using Activizr.Logic.Structure;
using Activizr.Logic.Tasks;
using Roles=Activizr.Logic.Pirates.Roles;
public partial class Controls_v4_ListLocalContacts : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
Geography geography = this.person.Geography;
Person lead = null;
if (!person.MemberOf(Organization.PPSE))
{
// PPSE only atm
return;
}
while (lead == null)
{
try
{
lead = Roles.GetLocalLead(Organization.PPSE, geography);
}
catch (ArgumentException)
{
geography = geography.Parent;
}
}
People deputies = Roles.GetLocalDeputies(Organization.PPSE, geography);
string literal =
"";
literal += FormatPerson("lead", lead) + " (" + Server.HtmlEncode(geography.Name) + ")
";
foreach (Person deputy in deputies)
{
literal += FormatPerson("deputy", deputy);
}
literal += "";
/*
literal +=
"
" +
"Party Secretary, 010-3333-404";*/
this.LiteralContacts.Text = literal;
}
private string FormatPerson (string iconPart, Person person)
{
string result = string.Empty;
result = "
" +
"" + Server.HtmlEncode(person.Name) + ", " + Server.HtmlEncode(person.Phone) + "";
return result;
}
public Person Person
{
get { return this.person; }
set { this.person = value; }
}
private Person person;
}