public ActionResult StaffDetails(int id = 0) //userid { if (id > 0) { //Edit existing Staff Account var user = _coreRepo.Get <User>(id); Instructor staff = _staffRepo.GetStaffByUserId(id); if (staff != null) { staff.Person.ProfilePhotoUrl = _generalHelper.GetStaffProfilePhoto(staff); } var model = new UserInfoViewModel() { User = user, Person = staff.Person }; return(View(model)); } else { //Create new Staff Account var model = new UserInfoViewModel() { User = new User(), Person = new Person() }; return(View(model)); } }
public ViewResult EditStaffProfile() { String userId = User.Identity.GetUserId(); Instructor staff = _staffRepo.GetStaffByUserId(int.Parse(userId)); var model = new EditPerson(staff); model.CurrentProfilePhotoUrl = _generalHelper.GetStaffProfilePhoto(staff); model.CountryOptions = new SelectList(_coreRepo.GetAll <Country>().OrderByDescending(x => x.Id), "Id", "Name").ToList(); return(View(model)); }