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 = "<span style=\"line-height:150%\">"; literal += FormatPerson("lead", lead) + " (" + Server.HtmlEncode(geography.Name) + ")<br/>"; foreach (Person deputy in deputies) { literal += FormatPerson("deputy", deputy); } literal += "</span>"; /* * literal += * "<br/><img src=\"/Images/Public/Fugue/icons-shadowless/pwcustom/orglevel-2-male.png\" style=\"position:relative;top:3px\" /> " + * "<a href=\"mailto:[email protected]\">Party Secretary</a>, <a href=\"callto:+46-10-3333-404\">010-3333-404</a>";*/ this.LiteralContacts.Text = literal; }
private void LoadMail() { int organizationId = Convert.ToInt32(this.DropOrganizations.SelectedValue); int geographyId = 0; if (this.DropGeographies.SelectedIndex > -1) { geographyId = Convert.ToInt32(this.DropGeographies.SelectedValue); AutoMail mail = AutoMail.FromTypeOrganizationAndGeography( AutoMailType.Welcome, Organization.FromIdentity(organizationId), Geography.FromIdentity(geographyId)); HttpContext.Current.Session["AutoMail"] = mail; this.PanelMailContents.Visible = true; if (mail != null) { this.TextBody.Text = mail.Body; } else { this.TextBody.Text = string.Empty; } } else { this.LabelSelectedGeography.Text = string.Empty; this.LabelOrganizationsInGeographies2.Text = string.Empty; } try { Person localLead = Roles.GetLocalLead(organizationId, geographyId); this.LabelSender.Text = localLead.Name; this.LabelSender.CssClass = string.Empty; } catch (Exception) { this.LabelSender.Text = "No Local Lead"; this.LabelSender.CssClass = "ErrorMessage"; } CreatePreview(); }