Example #1
0
        public static byte[] UserFoto(this HtmlHelper htmlHelper,
                                      System.Security.Principal.IPrincipal utilizador)
        {
            byte[] foto = null;

            using (var context = new Data.M17E_CadernetaContext())
            {
                var user = context.Users.Where(u => u.Id.ToString() == utilizador.Identity.Name).ToList()[0];

                foto = user.foto;
            }

            return(foto);
        }
Example #2
0
        public static string UserName(this HtmlHelper htmlHelper,
                                      System.Security.Principal.IPrincipal utilizador)
        {
            string UserName = "";

            using (var context = new Data.M17E_CadernetaContext())
            {
                var user = context.Users.Where(u => u.Id.ToString() == utilizador.Identity.Name).ToList()[0];

                UserName = user.Nome;
            }

            return(UserName);
        }