comparison 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
comparison
equal deleted inserted replaced
99:3027c64344bd 100:cc91817a4206
1 using System.Web;
2 using System.Web.Mvc;
3 using AltNetHispano.Agendas.Domain;
4
5 namespace AltNetHispano.Agendas.Web
6 {
7 public static class IdentityHelper
8 {
9 public static string DisplayName(this HtmlHelper<dynamic> helper)
10 {
11 var personaRepository = Factories.AgendaFactory.GetPersonaRepository();
12
13 var identification = new Identification(HttpContext.Current.User.Identity.Name);
14
15 var c = personaRepository.GetCuenta(identification.IdentityProvider, identification.LogonName);
16 return c == null ? identification.LogonName : c.Persona != null ? c.Persona.Nombre : c.LogonName;
17 }
18 }
19 }