Skip to content

Instantly share code, notes, and snippets.

@d630
d630 / Abteilung.cs
Last active July 6, 2018 01:34
Übung 1: C# + Windows Forms + MySQL (without DataGridView and MySqlDataAdapter)
namespace Datenbank
{
class Abteilung
{
public int abtNr;
public string abtName;
public Abteilung(int abtNr, string abtName)
{
this.abtNr = abtNr;
@d630
d630 / Baum.cs
Last active July 13, 2018 02:19
Tag 13: Baum
namespace Baum
{
public class Baum
{
private int nr;
private double x;
private double y;
private short sta;
private float kro;
private string art;
@d630
d630 / Form1.cs
Created June 21, 2018 12:39
Bilder bewegen
// TODO
@d630
d630 / Form1.cs
Created June 21, 2018 12:40
Windows Forms: r/w file
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 System.IO;
@d630
d630 / aufgaben.sql
Last active July 13, 2018 02:27
Tag 14/24: SQL-Uebung
-- a)
UPDATE mitarbeiter
SET tagesarbeitszeit = 7
WHERE ma_id = 812;
-- b)
SELECT count(*)
FROM mitarbeiter
WHERE tagesarbeitszeit < 7.33;
namespace Test
{
public class Auswahl
{
public Auswahl(Produkt pro, int anzahl)
{
this.Pro = pro;
this.Anzahl = anzahl;
this.Preis = pro.Preis * anzahl;
}
@d630
d630 / DB.cs
Last active July 6, 2018 01:33
Übung 2: C# + Windows Forms + MySQL + XML (without DataGridView and MySqlDataAdapter)
using System;
using System.Collections.Generic;
using MySql.Data.MySqlClient;
using System.Windows.Forms;
// TODO: avoid injections
// TODO: Better exception handling
namespace PersonalDB
{
@d630
d630 / q.sql
Last active July 4, 2018 23:40
Tag 17
-- 1)
SELECT *
FROM mitarbeiter
WHERE tagesarbeitszeit IS NULL OR tagesarbeitszeit < 7;
-- 2)
UPDATE mitarbeiter
SET tagesarbeitszeit = tagesarbeitszeit + tagesarbeitszeit * 0.10
WHERE tagesarbeitszeit IS NOT NULL;
@d630
d630 / Program.cs
Last active July 4, 2018 23:03
Tag 16: r/w
using System;
using System.Collections.Generic;
using System.IO;
namespace person
{
class Person
{
public Person(string nachname, string vorname)
{