public string InsertLog(LogsGenerals data) { _logsRepository.Insert(data); _logsRepository.Save(); return(""); }
public async Task <IActionResult> InsertLog([FromBody][Required] PostLogRequestDto data) { StatusResponseDto responseDto; try { responseDto = new StatusResponseDto(); DateTime dtNow = DateTime.UtcNow; LogsGenerals LogPetition = new LogsGenerals { TypeLog = data.TypeLog, Description = data.Description, HourLog = dtNow, UserId = data.UserId, CallsId = data.CallsId }; _securityService.InsertLog(LogPetition); responseDto.Status = "OK"; return(StatusCode(StatusCodes.Status200OK, responseDto)); } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, e)); } }
public void InsertLogSignIn(Supervisors supervisor, PostBOSigninResponseModel signinModel) { if (supervisor != null) { DateTime dtNow = DateTime.UtcNow; LogsGenerals LogPetition = new LogsGenerals { TypeLog = "Log De Peticion Supervisor", Description = "Inicio De Sesion", HourLog = dtNow, UserId = supervisor.Id, CallsId = null }; _logsRepository.Insert(LogPetition); _logsRepository.Save(); } else if (supervisor == null) { DateTime dtNow = DateTime.UtcNow; LogsGenerals LogPetition = new LogsGenerals { TypeLog = "Log De Respuesta Supervisor", Description = "No se encuentra registrado", HourLog = dtNow, UserId = null, CallsId = null }; _logsRepository.Insert(LogPetition); _logsRepository.Save(); } else if (signinModel.status == ResultStatus.SUCCESS) { DateTime dtNow = DateTime.UtcNow; LogsGenerals LogPetition = new LogsGenerals { TypeLog = "Log De Respuesta", Description = "Inico De Sesion Exitoso", HourLog = dtNow, UserId = supervisor.Id, CallsId = null }; _logsRepository.Insert(LogPetition); _logsRepository.Save(); } }
public string RequestLog(string msg) { DateTime dtNow = DateTime.UtcNow; LogsGenerals LogPetition = new LogsGenerals { TypeLog = "Log del Sistema", Description = msg, HourLog = dtNow, UserId = 0, CallsId = 0 }; _logsRepository.Insert(LogPetition); _logsRepository.Save(); return(""); }