removed unecessary if case
This commit is contained in:
10
Form1.cs
10
Form1.cs
@@ -42,7 +42,8 @@ namespace it_projekt
|
|||||||
Database.resetDatabase();
|
Database.resetDatabase();
|
||||||
MessageBox.Show("Verbindung mit der Datenbank fehlgeschlagen :( \nVersuchen Sie es erneut.", "Datenbank Fehler!");
|
MessageBox.Show("Verbindung mit der Datenbank fehlgeschlagen :( \nVersuchen Sie es erneut.", "Datenbank Fehler!");
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
foreach (Person person in db.Persons)
|
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);
|
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>();
|
List<Person> markedUsers = new List<Person>();
|
||||||
foreach (DataGridViewRow row in dataGrid.Rows)
|
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)
|
if (markedUsers.Count == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user