Example #1
0
        public ViewModel()
        {
            profile = new UserProfile();

            profile.UserID = 0;
            profile.UserRegisterID = 0;
        }
        public int getProfileId(int userId)
        {
            _userProfile = new UserProfile();

            _userContext.UserProfileRepository.Find(a => a.UserID == userId);

            return _userProfile.UserProfileID;
        }
        public ActionResult Icon(ViewModel model)
        {
            int userId = (int)Session["UserId"];
            _profileBusiness = new ProfileBusiness();
            UserProfile profile = new UserProfile();
            _loginBusiness = new LoginBusiness();

            profile = _profileBusiness.getProfileInfo(userId);

            profile.IconID = model.profile.IconID;

            _profileBusiness.updateIcon(profile);

            return View();
        }
 public void updateIcon(UserProfile userProfile)
 {
     _userContext.UserProfileRepository.Update(userProfile);
      _userContext.Commit();
 }
        public UserProfile getProfileInfo(int userId)
        {
            _userProfile = _userContext.UserProfileRepository.Get().Where(a => a.UserID == userId).ToList().First();

            return _userProfile;
        }
 public void addProfile(UserProfile userProfile)
 {
     _userContext.UserProfileRepository.Create(userProfile);
      _userContext.Commit();
 }
 public ProfileBusiness()
 {
     _userContext = new UserContext(new DbContextFactory());
     _userProfile = new UserProfile();
 }