This commit is contained in:
marcusferl@weifer.de 2022-10-28 13:17:33 +02:00
parent ae2f615484
commit 4bbe404512
11 changed files with 42 additions and 102 deletions

View File

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Artikelverwaltung
namespace Artikelverwaltung
{
internal class Artikel
{
@ -23,7 +17,7 @@ namespace Artikelverwaltung
Artikelgruppe = artikelgruppe;
AktivFlag = aktivFlag;
}
public Artikel(uint artikelnummer,string artikelbeschreibung, string modellname, string artikelgruppe, bool aktivFlag)
public Artikel(uint artikelnummer, string artikelbeschreibung, string modellname, string artikelgruppe, bool aktivFlag)
{
_Artikelnummer = artikelnummer;
Artikelbeschreibung = artikelbeschreibung;
@ -41,7 +35,7 @@ namespace Artikelverwaltung
}
// Getter - Setter
public uint Artikelnummer { get => _Artikelnummer;}
public uint Artikelnummer { get => _Artikelnummer; }
public string Artikelbeschreibung { get => _Artikelbeschreibung; set => _Artikelbeschreibung = value; }
public string Modellname { get => _Modellname; set => _Modellname = value; }
public string Artikelgruppe { get => _Artikelgruppe; set => _Artikelgruppe = value; }

View File

@ -1,13 +1,5 @@
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;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace Artikelverwaltung
{

View File

@ -1,11 +1,4 @@
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 Artikelverwaltung
@ -27,11 +20,12 @@ namespace Artikelverwaltung
string artikelGruppe = AnlegenTextBoxArtikelGruppe.Text;
bool aktiveFlag = false;
if(checkBoxFlag.CheckState == CheckState.Checked)
if (checkBoxFlag.CheckState == CheckState.Checked)
{
aktiveFlag = true;
}
artikelverwaltung.ArtikelAnlegen(artikelBeschreibung, modellName, artikelGruppe, aktiveFlag);
MessageBox.Show($"{modellName} wurde angelegt!");
this.Close();
}
}

View File

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Windows.Forms;
namespace Artikelverwaltung

View File

@ -1,11 +1,6 @@
using MySqlConnector;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Artikelverwaltung
@ -28,19 +23,19 @@ namespace Artikelverwaltung
{
try
{
connection.Open();
cmd.Connection = connection;
cmd.CommandText = $"select count(*) as result from mitarbeiter where benutzername = '{bn}' and passwort = '{pw}'";
MySqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
if(reader["result"].ToString().Equals("1"))
connection.Open();
cmd.Connection = connection;
cmd.CommandText = $"select count(*) as result from mitarbeiter where benutzername = '{bn}' and passwort = '{pw}'";
MySqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
connection.Close();
return true;
if (reader["result"].ToString().Equals("1"))
{
connection.Close();
return true;
}
}
}
connection.Close();
connection.Close();
}
catch
{
@ -139,14 +134,14 @@ namespace Artikelverwaltung
int result = 0;
try
{
connection.Open();
cmd.Connection = connection;
cmd.CommandText = $"select count(*) as result from artikel";
MySqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
result = Convert.ToInt32(reader["result"]);
}
connection.Open();
cmd.Connection = connection;
cmd.CommandText = $"select count(*) as result from artikel";
MySqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
result = Convert.ToInt32(reader["result"]);
}
connection.Close();
return result;
}
@ -174,7 +169,7 @@ namespace Artikelverwaltung
connection.Close();
return list;
}
catch(Exception ex)
catch (Exception ex)
{
//"SQL Error"
MessageBox.Show(ex.ToString());

View File

@ -1,12 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Artikelverwaltung
@ -38,7 +31,7 @@ namespace Artikelverwaltung
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if(checkBox1.CheckState != CheckState.Checked)
if (checkBox1.CheckState != CheckState.Checked)
{
textBoxPasswort.PasswordChar = '*';
}

View File

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Artikelverwaltung
namespace Artikelverwaltung
{
internal class MitarbeiterAccount
{

View File

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Artikelverwaltung

View File

@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden

View File

@ -1,12 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Artikelverwaltung

View File

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Artikelverwaltung
namespace Artikelverwaltung
{
internal class Zugriffsverwaltung
{
@ -14,10 +8,10 @@ namespace Artikelverwaltung
{
bool access = false;
if (dbConnection.loginAbgleich(bn,pw))
{
access = true;
}
if (dbConnection.loginAbgleich(bn, pw))
{
access = true;
}
return access;
}
public bool benutzerAnlegen(string bn, string pw)