Agribusiness.Web.Controllers.PersonController.UpdateProfilePicture C# (CSharp) Method

UpdateProfilePicture() public method

public UpdateProfilePicture ( int id, int seminarId, bool admin = false ) : ActionResult
id int
seminarId int
admin bool
return ActionResult
        public ActionResult UpdateProfilePicture(int id, int? seminarId, bool admin = false)
        {
            var person = _personRepository.GetNullableById(id);

            if (person == null)
            {
                Message = string.Format(Messages.NotFound, "Person", id);
                return this.RedirectToAction(a => a.SiteList());
            }

            // validate this is the person or is a person in user role
            if (person.User.LoweredUserName != CurrentUser.Identity.Name.ToLower() && !Roles.IsUserInRole(RoleNames.User))
            {
                return this.RedirectToAction<ErrorController>(a => a.NotAuthorized());
            }

            // set this to check for admin routing back to attendee edit page
            ViewBag.SeminarId = seminarId;
            ViewBag.Admin = admin;

            return View(person);
        }

Same methods

PersonController::UpdateProfilePicture ( int id, int seminarId, int x, int y, int height, int width, bool admin = false ) : ActionResult