public async Task <IActionResult> DeleteProperty(int id)
        {
            await _propertyService.DeleteAsync(id);

            var response = new ApiResponse <bool>(true);

            return(Ok(response));
        }
Exemple #2
0
        public async Task <IActionResult> Delete(string id, bool doDeleteValues = false)
        {
            //var property = _propertyService.GetById(id);

            //CheckCurrentUserHasPermissionForObjects(CatalogPredefinedPermissions.Delete, property);
            await _propertyService.DeleteAsync(new[] { id }, doDeleteValues);

            return(NoContent());
        }
        public async Task <IActionResult> Delete(long id)
        {
            var result = await _propertyService.DeleteAsync(id);

            if (result == Business.Dto.OperationResult.NotFound)
            {
                return(NotFound());
            }

            return(RedirectToAction(nameof(Details), new { id }));
        }
Exemple #4
0
 public async Task <IActionResult> DeleteAsync(int propertyId)
 {
     try
     {
         return(Ok(await _service.DeleteAsync(propertyId)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
        public async Task <ActionResult> DeleteProperty(string id, bool doDeleteValues = false)
        {
            var property = await _propertyService.GetByIdsAsync(new[] { id });

            var authorizationResult = await _authorizationService.AuthorizeAsync(User, property, new CatalogAuthorizationRequirement(ModuleConstants.Security.Permissions.Delete));

            if (!authorizationResult.Succeeded)
            {
                return(Unauthorized());
            }
            await _propertyService.DeleteAsync(new[] { id }, doDeleteValues);

            return(NoContent());
        }
Exemple #6
0
        // GET: Properties/Delete/5
        public async Task <IActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var property = await _propertyService.DeleteAsync((int)id);

            if (property == null)
            {
                return(NotFound());
            }

            return(View(property));
        }
Exemple #7
0
        public async Task <ActionResult> Delete(int id)
        {
            await propertyService.DeleteAsync(id);

            return(Ok());
        }
Exemple #8
0
        public override async Task <DeletePropertyResponse> DeleteProperty(DeletePropertyRequest request, ServerCallContext context)
        {
            await _propertyService.DeleteAsync(request.AgencyId, request.Id);

            return(new DeletePropertyResponse());
        }
        public async Task <IActionResult> Delete(int id)
        {
            await _service.DeleteAsync(UserInfo.AgencyId, id);

            return(NoContent());
        }
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            await propertyService.DeleteAsync(id);

            return(RedirectToAction("Index"));
        }