diff Agendas/trunk/src/Agendas.Web/IdentityHelper.cs @ 100:cc91817a4206

Merge
author jorge.rowies
date Sat, 04 Jun 2011 22:46:06 -0300
parents 1eb5a0e531bf
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Agendas/trunk/src/Agendas.Web/IdentityHelper.cs	Sat Jun 04 22:46:06 2011 -0300
@@ -0,0 +1,19 @@
+using System.Web;
+using System.Web.Mvc;
+using AltNetHispano.Agendas.Domain;
+
+namespace AltNetHispano.Agendas.Web
+{
+	public static class IdentityHelper
+	{
+		public static string DisplayName(this HtmlHelper<dynamic> helper)
+		{
+			var personaRepository = Factories.AgendaFactory.GetPersonaRepository();
+			
+			var identification = new Identification(HttpContext.Current.User.Identity.Name);
+
+			var c = personaRepository.GetCuenta(identification.IdentityProvider, identification.LogonName);
+			return c == null ? identification.LogonName : c.Persona != null ? c.Persona.Nombre : c.LogonName;
+		}
+	}
+}
\ No newline at end of file