예제 #1
0
        public ActionResultDTO Post(ComputerLogEntity computerLog)
        {
            var result = _computerLogServices.AddComputerLog(computerLog);

            if (result == null)
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
            }
            return(result);
        }
예제 #2
0
        public ActionResultDTO AddComputerLog(ComputerLogEntity computerLog)
        {
            var actionResult = new ActionResultDTO();

            computerLog.LogTime = DateTime.Now;
            _uow.ComputerLogRepository.Insert(computerLog);
            _uow.Save();
            actionResult.Success = true;
            actionResult.Id      = computerLog.Id;

            return(actionResult);
        }
예제 #3
0
        public ActionResultDTO Post(ComputerLogEntity tObject)
        {
            Request.Method = Method.POST;
            Request.AddJsonBody(tObject);
            Request.Resource = string.Format("api/{0}/Post/", Resource);
            var response = _apiRequest.Execute <ActionResultDTO>(Request);

            if (response.Id == 0)
            {
                response.Success = false;
            }
            return(response);
        }
예제 #4
0
        public void UploadLog(string computerId, string logContents, string subType, string computerMac)
        {
            if (computerId == "false")
            {
                computerId = "-1";
            }
            var computerLog = new ComputerLogEntity
            {
                ComputerId = Convert.ToInt32(computerId),
                Contents   = logContents,
                Type       = "image",
                SubType    = subType,
                Mac        = computerMac
            };

            new ComputerLogServices().AddComputerLog(computerLog);
        }