Files
it-projekt/Form1.cs
2022-05-09 15:01:30 +02:00

63 lines
1.5 KiB
C#

using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace it_projekt
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void searchBtn_Click(object sender, EventArgs e)
{
foreach(DataGridViewRow row in dataGrid.Rows)
{
List<int> markedUsers = new List<int>();
if (row.Cells[4].Value != null)
{
if (row.Cells[4].Value.ToString() == "True")
{
MessageBox.Show("geht");
}
}
}
}
private void loginBtn_Click(object sender, EventArgs e)
{
LoadUsersFromTable(userTxt.Text,passTxt.Text);
}
public void LoadUsersFromTable(string user, string password)
{
Database db = new Database(user, password);
foreach (Person person in db.Persons)
{
this.dataGrid.Rows.Add(person.Id, person.Firstname, person.Lastname, person.CreationDate, false);
}
}
private void dataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
}
}