Esempio n. 1
0
        public ActionResult Edit(UserViewModel user)
        {
            UserModel dbUser = new UserModel()
            {
                LoginID     = User.Identity.GetUserId(),
                UserName    = user.UserName,
                Description = user.Description
            };

            IDBConnector db = DBConnectorFactory.GetDBConnector();

            db.UpdateUser(dbUser);
            user.Tags = db.SelectUserTags(dbUser.LoginID);
            user.SocialMediaAccounts = db.SelectUserSocialMedia(dbUser.LoginID);

            return(View(user));
        }
Esempio n. 2
0
        private UserViewModel PopulateUserModel()
        {
            string       loginID = User.Identity.GetUserId();
            IDBConnector db      = DBConnectorFactory.GetDBConnector();
            UserModel    user    = db.SelectUser(loginID);

            UserViewModel userView = new UserViewModel()
            {
                UserName    = user.UserName,
                Description = user.Description
            };

            userView.Tags = db.SelectUserTags(loginID);
            userView.SocialMediaAccounts = db.SelectUserSocialMedia(loginID);

            return(userView);
        }