예제 #1
0
 public void UpdateFailure(FailiureDto dtoToUpdate)
 {
     List<FailiureDto> failList = ReadAllFailiures();
     var existingFailiure = failList.First(s => s.Process == dtoToUpdate.Process);
     failList.Remove(existingFailiure);
     failList.Add(existingFailiure);
     OverwriteFile(failList);
 }
예제 #2
0
        public List<FailiureDto> ReadAllFailiures()
        {
            List<FailiureDto> failList = new List<FailiureDto>();

            var reader = File.ReadAllLines(FilePath);

            for (int i = 1; i < reader.Length; i++)
            {
                var columns = reader[i].Split(',');

                var column = new FailiureDto();

                column.Process = columns[0];
                column.Date = DateTime.Parse(columns[1]);
                column.Message = columns[2];
                failList.Add(column);
            }

            return failList;
        }
예제 #3
0
 public void CreateFailure(FailiureDto inFailDto)
 {
     var failList = ReadAllFailiures();
     failList.Add(inFailDto);
     OverwriteFile(failList);
 }
예제 #4
0
 private void LogFailiure(string process, DateTime date, string message)
 {
     var fDto = new FailiureDto();
     fDto.Process = process;
     fDto.Message = message;
     var fRepo = new FailiureRepo();
     fRepo.CreateFailure(fDto);
 }