public IActionResult Get([FromQuery] PaginationParameters paginationParameters) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = new OrganisationProfileManager(context, userManager).GetOrganisationProfiles(hostingEnvironment.WebRootPath, paginationParameters.Skip, paginationParameters.Take); return(Ok(new { success = result.Success, message = result.Message, data = result.Data })); }
public IActionResult Put([FromRoute] int id, OrganisationProfileModel organisationProfileModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = new OrganisationProfileManager(context, userManager).UpdateOrganisationProfile(organisationProfileModel, hostingEnvironment.WebRootPath).Result; return(Ok(new { success = result.Success, message = result.Message, data = result.Data })); }
public IActionResult Delete([FromRoute] int id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = new OrganisationProfileManager(context, userManager).DeleteOrganisationProfile(id); return(Ok(new { success = result.Success, message = result.Message, data = result.Data })); }
public IActionResult Post(AddOrganisationProfileModel organisationDetailsModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = new OrganisationProfileManager(context, userManager).SaveOrganisationProfile(organisationDetailsModel, hostingEnvironment.WebRootPath, User.FindFirst(ClaimTypes.NameIdentifier).Value).Result; return(Ok(new { success = result.Success, message = result.Message, data = result.Data })); }
public IActionResult Get([FromRoute] string organisationUserId) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = new OrganisationProfileManager(context, userManager).GetOrganisationProfileById(organisationUserId, hostingEnvironment.WebRootPath); if (result.Data == null) { return(NotFound()); } return(Ok(new { success = result.Success, message = result.Message, data = result.Data })); }