This commit is contained in:
Blauschleim
2022-05-09 14:16:36 +02:00
4 changed files with 15 additions and 13 deletions

View File

@@ -29,16 +29,15 @@ namespace it_projekt
private void loginBtn_Click(object sender, EventArgs e) private void loginBtn_Click(object sender, EventArgs e)
{ {
LoadUsersFromTable("",""); LoadUsersFromTable("root","");
} }
public static void LoadUsersFromTable(string user, string password) public static void LoadUsersFromTable(string user, string password)
{ {
string connectionString = "server=localhost;database=stammdaten;User Id=" + user + ";Password=" + password + ";"; Database test = new Database(user, password);
Database test = new Database(connectionString); MessageBox.Show(test.Person.Firstname);
MessageBox.Show(test.persons.Find(1).Firstname);
} }
private void dataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e) private void dataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)

View File

@@ -8,9 +8,17 @@ namespace it_projekt
{ {
class Person class Person
{ {
public int Id { get; set; } public string Id { get; set; }
public string Lastname { get; set; } public string Lastname { get; set; }
public string Firstname { get; set; } public string Firstname { get; set; }
public DateTime CreationDate { get; set; } public DateTime CreationDate { get; set; }
public Person(string Id, string Lastname, string Firstname, DateTime CreationDate)
{
this.Id = Id;
this.Lastname = Lastname;
this.Firstname = Firstname;
this.CreationDate = CreationDate;
}
} }
} }

View File

@@ -1,4 +1 @@
# it-projekt # it-projekt
SUPER PROJEKT, ICH SAGS EUCH, schw<68>re!
# OK Cool

View File

@@ -8,9 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="EntityFramework" Version="6.4.4" />
<PackageReference Include="MySql.Data" Version="8.0.29" /> <PackageReference Include="MySql.Data" Version="8.0.29" />
<PackageReference Include="MySqlConnector" Version="2.1.8" />
</ItemGroup> </ItemGroup>
</Project> </Project>