removed unecessary if case

This commit is contained in:
Blauschleim
2022-05-16 20:06:01 +02:00
parent fbe77f4fb3
commit afcebcbeaf

View File

@@ -42,7 +42,8 @@ namespace it_projekt
Database.resetDatabase();
MessageBox.Show("Verbindung mit der Datenbank fehlgeschlagen :( \nVersuchen Sie es erneut.", "Datenbank Fehler!");
}
else {
else
{
foreach (Person person in db.Persons)
{
this.dataGrid.Rows.Add(person.Id, person.Firstname, person.Lastname, person.Department_short, person.Department_long, person.CreationDate, false);
@@ -67,12 +68,9 @@ namespace it_projekt
List<Person> markedUsers = new List<Person>();
foreach (DataGridViewRow row in dataGrid.Rows)
{
if (row.Cells[6].Value != null)
if (Convert.ToBoolean(row.Cells[6].Value))
{
if (row.Cells[6].Value.ToString() == "True")
{
markedUsers.Add(db.Persons.Find(person => person.Id == row.Cells[0].Value.ToString()));
}
markedUsers.Add(db.Persons.Find(person => person.Id == row.Cells[0].Value.ToString()));
}
}
if (markedUsers.Count == 0)