예제 #1
0
        public ActionResult Settings([Bind(Include = "AppUserId,MaxDistanceFilter,MaxAgeFilter,SelectionLevelFilter")] AppUserSettingsView view)
        {
            if (Request.Form["resetbutton"] != null)
            {
                return(RedirectToAction("Settings"));
            }

            if (ModelState.IsValid)
            {
                AppUserHelpers.UpdateAppUser(db, view, User);

                return(RedirectToAction("Index", "Home"));
            }
            return(View(view));
        }
예제 #2
0
        public ActionResult UserProfile([Bind(Include = "AppUserId,FirstName,LastName,EntityStatus,LoginEmail,PrivacyLevel,UserRole,SelectedOrganisationId,OrganisationName,BusinessType,AddressLine1,AddressLine2,AddressLine3,AddressTownCity,AddressCounty,AddressPostcode")] AppUserProfileView view)
        {
            if (Request.Form["resetbutton"] != null)
            {
                return(RedirectToAction("UserProfile"));
            }

            if (ModelState.IsValid)
            {
                //if selectedorganisationid is null then the organisation already exists so set that flag as a limited number of fields needs updating

                if (view.SelectedOrganisationId == null)
                {
                    AppUserHelpers.UpdateAppUser(db, view, User, true);
                }
                else
                {
                    AppUserHelpers.UpdateAppUser(db, view, User, false);
                }

                return(RedirectToAction("Dashboard", "Home"));
            }
            return(View(view));
        }