private void ExecuteLogClear()
 {
     if (this.ConnectionString == null && this.ConnectionString.Equals(""))
     {
         MessageBox.Show("Bitte Connectionstring eingeben!");
     }
     else
     {
         var logentryRepository = new LogEntryRepository();
         logentryRepository.ExecuteLogClear(SelectedEntry);
         LogEntriesList = logentryRepository.GetAll().ToList <LogEntry>();
         if (LogEntriesList.Any())
         {
             this.SelectedEntry = this.LogEntriesList.First();
         }
         OnPropertyChanged("LogEntriesList");
         OnPropertyChanged("SelectedEntry");
     }
 }
 public void ReadEntries()
 {
     if (!ConnectionOpen())
     {
         return;
     }
     try
     {
         LoggingEntries.Clear();
         var result = _dataRepository.GetAll();
         foreach (var i in result)
         {
             LoggingEntries.Add(i);
         }
     }
     catch (Exception ex)
     {
         Console.Error.WriteLine(string.Format("ERROR, Wrong Connection: {0}", 0), ex.Message);
     }
 }
 private void ExecuteLogMessageAdd()
 {
     if (this.ConnectionString == null && this.ConnectionString.Equals(""))
     {
         MessageBox.Show("Bitte Connectionstring eingeben!");
     }
     else
     {
         if (NewEntry.Pod == null || NewEntry.Hostname == null || NewEntry.Severity < 0 ||
             NewEntry.Message == null)
         {
             MessageBox.Show("Bitte alle Felder abfüllen!");
         }
         else
         {
             var logentryRepository = new LogEntryRepository();
             logentryRepository.ExecuteLogMessageAdd(this.NewEntry);
             this.LogEntriesList = logentryRepository.GetAll().ToList <LogEntry>();
             OnPropertyChanged("LogEntriesList");
         }
     }
 }
        private void RunDuplicatesChecker()
        {
            var dubChecker = new DuplicateChecker();
            var logRepo    = new LogEntryRepository();
            var logList    = logRepo.GetAll().ToList <LogEntry>();
            var dubList    = dubChecker.FindDuplicates(logList);

            if (dubList.Any())
            {
                for (int i = 0; i < dubList.Count(); i++)
                {
                    var log = (LogEntry)dubList.ElementAt(i);
                    for (int j = 0; j < logList.Count(); j++)
                    {
                        if (logList.ElementAt(j).Id == log.Id)
                        {
                            logList.ElementAt(j).IsDuplicate = true;
                        }
                    }
                }
            }
            this.LogEntriesList = logList;
            OnPropertyChanged("LogEntriesList");
        }