Esempio n. 1
0
        public JsonResult GetCrmuser(Guid id)
        {
            var crmuser = crmuserRepository.GetSingle(where : new { Id = id });

            crmuser = crmuser ?? new Crmuser();


            var result = new
            {
                crmuser = crmuser
            };

            return(Json(result));
        }
Esempio n. 2
0
        public ActionResult UsernameIsAvailable(string userName)
        {
            var valid = _crmUserRepository.GetSingle(new { UserName = userName }) == null;

            return(Json(new { valid = valid }));
        }
Esempio n. 3
0
        public static Guid GetUserId(this System.Security.Principal.IIdentity identity)
        {
            var usr = allUsers.GetSingle(where : new { UserName = identity.Name });

            return(usr != null? usr.Id : Guid.Empty);
        }