Esempio n. 1
0
        public ActionResult RegisterUserEdit(User user, int id)
        {
            var model = AuthenticationDB.GetUserByEmail(user.Email);

            if (model != null)
            {
                if (model.UserId != user.UserId)
                {
                    ModelState.AddModelError("Warning Email", "Sorry: Email already Exists");
                    return(View(user));
                }
            }
            else
            {
                model = AuthenticationDB.GetUserById(user.UserId);
            }
            model.FullName             = user.FullName;
            model.Email                = user.Email;
            model.IsActive             = user.IsActive;
            model.Phone                = user.Phone;
            model.CommunicationAddress = user.CommunicationAddress;
            AuthenticationDB.Save(model);

            return(RedirectToAction("RegisterUser"));
        }
Esempio n. 2
0
        public ActionResult UserProfile()
        {
            var name  = User.Identity.Name;
            var model = AuthenticationDB.GetUserByEmail(name);

            // View Model Conversation here....
            return(View(model));
        }
Esempio n. 3
0
        public override string GetUserNameByEmail(string email)
        {
            var user = AuthenticationDB.GetUserByEmail(email);

            if (user == null)
            {
                return(null);
            }

            return(user != null ? user.Email : string.Empty);
        }
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="username"></param>
        /// <param name="userIsOnline"></param>
        /// <returns></returns>
        public override MembershipUser GetUser(string username, bool userIsOnline)
        {
            var user = AuthenticationDB.GetUserByEmail(username);

            if (user == null)
            {
                return(null);
            }
            var selectedUser = new CustomMembershipUser(user);

            return(selectedUser);
        }