removed unecessary if case
This commit is contained in:
8
Form1.cs
8
Form1.cs
@@ -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,14 +68,11 @@ namespace it_projekt
|
||||
List<Person> markedUsers = new List<Person>();
|
||||
foreach (DataGridViewRow row in dataGrid.Rows)
|
||||
{
|
||||
if (row.Cells[6].Value != null)
|
||||
{
|
||||
if (row.Cells[6].Value.ToString() == "True")
|
||||
if (Convert.ToBoolean(row.Cells[6].Value))
|
||||
{
|
||||
markedUsers.Add(db.Persons.Find(person => person.Id == row.Cells[0].Value.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (markedUsers.Count == 0)
|
||||
{
|
||||
MessageBox.Show("Bitte wählen Sie mindestens eine Person zum exportieren aus!", "Exporter Error!");
|
||||
|
||||
Reference in New Issue
Block a user