private void CreatePreview() { Person currentPerson = Person.FromIdentity(Convert.ToInt32(HttpContext.Current.User.Identity.Name)); Organization org = Organization.FromIdentity(Convert.ToInt32(this.DropOrganizations.SelectedValue)); if (this.DropGeographies.SelectedIndex > -1) { Geography geo = Geography.FromIdentity(Convert.ToInt32(this.DropGeographies.SelectedValue)); WelcomeMail welcomemail = new WelcomeMail(); welcomemail.pSubject = this.TextSubject.Text; welcomemail.pBodyContent = this.TextBody.Text; welcomemail.pOrgName = org.MailPrefixInherited; welcomemail.pGeographyName = ""; if (geo.Identity != Geography.RootIdentity) { welcomemail.pGeographyName = geo.Name; } OutboundMail fake = welcomemail.CreateOutboundFake(currentPerson, org, geo); this.LiteralPreview.Text = fake.RenderHtml(currentPerson, org.DefaultCountry.Culture); } this.TextBody.Focus(); }
private void CreatePreview () { Person currentPerson = Person.FromIdentity(Convert.ToInt32(HttpContext.Current.User.Identity.Name)); Organization org = Organization.FromIdentity(Convert.ToInt32(this.DropOrganizations.SelectedValue)); if (this.DropGeographies.SelectedIndex > -1) { Geography geo = Geography.FromIdentity(Convert.ToInt32(this.DropGeographies.SelectedValue)); WelcomeMail welcomemail = new WelcomeMail(); welcomemail.pSubject = this.TextSubject.Text; welcomemail.pBodyContent = this.TextBody.Text; welcomemail.pOrgName = org.MailPrefixInherited; welcomemail.pGeographyName = ""; if (geo.Identity != Geography.RootIdentity) { welcomemail.pGeographyName = geo.Name; } OutboundMail fake = welcomemail.CreateOutboundFake(currentPerson, org, geo); this.LiteralPreview.Text = fake.RenderHtml(currentPerson, org.DefaultCountry.Culture); } this.TextBody.Focus(); }