public ActionResultDTO Post(ComputerLogEntity computerLog) { var result = _computerLogServices.AddComputerLog(computerLog); if (result == null) { throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound)); } return(result); }
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); }
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); }
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); }