removed unecessary if case
This commit is contained in:
14
Form1.cs
14
Form1.cs
@@ -14,7 +14,7 @@ namespace it_projekt
|
|||||||
private Database db = null;
|
private Database db = null;
|
||||||
public Form1()
|
public Form1()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.exportBtn.Enabled = false;
|
this.exportBtn.Enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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);
|
||||||
@@ -53,7 +54,7 @@ namespace it_projekt
|
|||||||
|
|
||||||
private void dataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
private void dataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private System.EventHandler test()
|
private System.EventHandler test()
|
||||||
@@ -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