reworked project structure, removed entityframework, add mysqlconnector

This commit is contained in:
2022-05-09 14:07:55 +02:00
parent cf27b19087
commit 66fe1206e9
4 changed files with 15 additions and 13 deletions

View File

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

View File

@@ -8,9 +8,17 @@ namespace it_projekt
{
class Person
{
public int Id { get; set; }
public string Id { get; set; }
public string Lastname { get; set; }
public string Firstname { 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
SUPER PROJEKT, ICH SAGS EUCH, schw<68>re!
# OK Cool

View File

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