up
This commit is contained in:
parent
ae2f615484
commit
4bbe404512
|
@ -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; }
|
||||
|
@ -57,6 +51,6 @@ namespace Artikelverwaltung
|
|||
{
|
||||
return $"ArtNr: {Artikelnummer} - Art.Beschreibung: {Artikelbeschreibung} - Modellname: {Modellname} - Gruppe: {Artikelgruppe} - Aktiv: {AktivFlag}";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,9 @@
|
|||
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
|
||||
{
|
||||
|
||||
|
||||
public partial class Artikel_Aendern : Form
|
||||
{
|
||||
Artikel_Verwaltung artikel_Verwaltung;
|
||||
|
|
|
@ -1,16 +1,9 @@
|
|||
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
|
||||
{
|
||||
|
||||
|
||||
public partial class Artikel_Anlegen : Form
|
||||
{
|
||||
Artikel_Verwaltung 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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
@ -15,7 +10,7 @@ namespace Artikelverwaltung
|
|||
string connectionString;
|
||||
MySqlConnection connection;
|
||||
MySqlCommand cmd;
|
||||
|
||||
|
||||
public Database()
|
||||
{
|
||||
connectionString = "Server=localhost;User=root;Password=;Database=Artikelverwaltung";
|
||||
|
@ -28,24 +23,24 @@ 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
|
||||
{
|
||||
MessageBox.Show("SQL Error");
|
||||
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -155,7 +150,7 @@ namespace Artikelverwaltung
|
|||
MessageBox.Show("SQL Error");
|
||||
connection.Close();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
public List<Artikel> BestimmteAnzahlanArtikeln(int start, int anzahl)
|
||||
{
|
||||
|
@ -174,7 +169,7 @@ namespace Artikelverwaltung
|
|||
connection.Close();
|
||||
return list;
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
//"SQL Error"
|
||||
MessageBox.Show(ex.ToString());
|
||||
|
|
|
@ -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 = '*';
|
||||
}
|
||||
|
@ -55,7 +48,7 @@ namespace Artikelverwaltung
|
|||
}
|
||||
private void AritelverwaltunForm(object obj)
|
||||
{
|
||||
Application.Run(new Artikelverwaltung());
|
||||
Application.Run(new Artikelverwaltung());
|
||||
}
|
||||
|
||||
private void beenden_Button_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Artikelverwaltung
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
@ -13,11 +7,11 @@ namespace Artikelverwaltung
|
|||
public bool loginArtikelverwaltung(string bn, string pw)
|
||||
{
|
||||
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)
|
||||
|
@ -31,7 +25,7 @@ namespace Artikelverwaltung
|
|||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user