Exemple #1
0
        public DtoApiBoolResponse IsStorageRemote()
        {
            var response     = new DtoApiBoolResponse();
            var storageValue = ServiceSetting.GetSettingValue(SettingStrings.StorageType);

            response.Value = storageValue.Equals("SMB");
            return(response);
        }
        public DtoApiBoolResponse SendMessage(int id, DtoMessage message)
        {
            var response = new DtoApiBoolResponse()
            {
                Value = _computerServices.SendMessage(id, message)
            };
            var computer = _computerServices.GetComputer(id);

            if (computer != null)
            {
                var auditLog = new EntityAuditLog();
                auditLog.ObjectType = "Computer";
                auditLog.ObjectId   = id;
                auditLog.ObjectName = computer.Name;
                auditLog.ObjectJson = JsonConvert.SerializeObject(message);
                auditLog.UserId     = _userId;
                auditLog.AuditType  = EnumAuditEntry.AuditType.Message;
                _auditLogService.AddAuditLog(auditLog);
            }
            return(response);
        }