Example #1
0
        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 }));
        }
Example #2
0
        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 }));
        }
Example #3
0
        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 }));
        }
Example #4
0
        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 }));
        }
Example #5
0
        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 }));
        }