示例#1
0
        public new ActionResult Profile()
        {
            ProfileModel profile = new ProfileModel();
            var userid = Convert.ToInt32(Session["UserID"]);
            profile.about = _manageRepository.getPAboutById(userid);
            profile.visible = _manageRepository.getHide(userid);
            profile.userid = userid;
            profile.pic = _manageRepository.getPic(userid);

            return View(profile);
        }
示例#2
0
 public ActionResult BrowseUser()
 {
     int id = Int32.Parse(Request.RequestContext.RouteData.Values["id"].ToString());
     Profiles user = _usersRepository.getUserByID(id);
     ProfileModel profile = new ProfileModel();
     profile.about = user.About;
     profile.age = user.Age;
     profile.email = user.Email;
     profile.pic = user.Pic;
     profile.name = user.Firstname + user.Lastname;
     profile.userid = user.Id;
     return View(profile);
 }
示例#3
0
        public new ActionResult Profile(ProfileModel profile)
        {
            var userid = Convert.ToInt32(Session["UserID"]);
            if (profile.File != null && profile.File.ContentLength > 0)
            {
                var fileName = Path.GetFileName(profile.File.FileName);
                var parts = fileName.Split('.');
                fileName = userid + "." +parts[1];
                var path = Path.Combine(Server.MapPath("~/Content/ProfileImages"), fileName);
                profile.File.SaveAs(path);
                _manageRepository.setPic(userid, fileName);
            }
            _manageRepository.setPAboutById(userid, profile.Aboutbox);
            _manageRepository.setHide(userid, profile.Visibility);
            


            return RedirectToAction("Profile");
        }