Exemplo n.º 1
0
        public ActionResultDTO Delete(int id)
        {
            var computer = _computerService.GetComputer(id);
            var result   = _computerService.DeleteComputer(id);

            if (result.Success)
            {
                _auditLog.AuditType  = AuditEntry.Type.Delete;
                _auditLog.ObjectId   = result.Id;
                _auditLog.ObjectName = computer.Name;
                _auditLog.Ip         = Request.GetClientIpAddress();
                _auditLogService.AddAuditLog(_auditLog);
            }
            return(result);
        }
Exemplo n.º 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);
        }