public ActionResult SwitchCountryProgramme(SwitchCPModel model) { if (userContext.HasPermission(StandardPermissionProvider.MultipleCountryProgrammeAccess)) { var staff = m_StaffService.GetStaffById(currentStaff.Id); staff.CountrySubOfficeId = model.SubOfficeId; m_StaffService.UpdateStaff(staff); //clear cache then update Current User in HttpContext m_cacheService.Clear(); userContext.CurrentUser = m_SystemUserService.GetUserByEmail(currentStaff.Person.OfficialEmail, false); } //redirect to Dashboard return(Redirect("/Dashboard/")); }
public ActionResult SwitchCountryProgramme() { if (!userContext.HasPermission(StandardPermissionProvider.MultipleCountryProgrammeAccess)) { return(Content("<b><font color=Red>" + Resources.SystemUserController_String_ActionNotPermitted + "</font></b>", "text/html")); } SwitchCPModel model = new SwitchCPModel(); model.CountryProgrammes = new SelectList(m_CountrySubOfficeService.CountryProgObj.GetCountryProgrammes(), "Id", "ProgrammeName", countryProg.Id); model.CountryProgrammeId = countryProg.Id; model.SubOffices = new SelectList(m_CountrySubOfficeService.GetCountrySubOffices(countryProg.Id), "Id", "Name", currentStaff.CountrySubOfficeId); model.SubOfficeId = currentStaff.CountrySubOfficeId.HasValue ? currentStaff.CountrySubOfficeId.Value : Guid.Empty; return(View("SwitchCountryProgramme", model)); }