Пример #1
0
        public async Task <ActionResult> RemoveImage(int id)
        {
            _logger.Info("Removing Image! ImageId: " + id);
            try
            {
                await _imageServices.DeleteImage(id, User.Identity.GetUserId());

                _logger.Info("Removing Image Successfully!");

                return(Json("STATUS_OK"));
            }
            catch (Exception ex)
            {
                _logger.Error(ex, "Removing Image Failed!");
                throw;
            }
        }
Пример #2
0
        public ActionResultDTO Delete(int id)
        {
            var image  = _imageServices.GetImage(id);
            var result = _imageServices.DeleteImage(id);

            if (result == null)
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
            }
            if (result.Success)
            {
                _auditLog.AuditType  = AuditEntry.Type.Delete;
                _auditLog.ObjectId   = result.Id;
                _auditLog.ObjectName = image.Name;
                _auditLog.Ip         = Request.GetClientIpAddress();
                _auditLogService.AddAuditLog(_auditLog);
            }
            return(result);
        }
Пример #3
0
        public async Task <ActionResult> DeleteImage(int id)
        {
            await _imagesManager.DeleteImage(id, User.Identity.GetUserId());

            return(Json("STATUS_OK"));
        }