示例#1
0
        public string InsertLog(LogsGenerals data)
        {
            _logsRepository.Insert(data);
            _logsRepository.Save();

            return("");
        }
示例#2
0
        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));
            }
        }
示例#3
0
        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();
            }
        }
示例#4
0
        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("");
        }