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