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)); }
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); }