56 lines
1.2 KiB
C#
56 lines
1.2 KiB
C#
using DatenDB;
|
|
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 Deckungsbeitrag
|
|
{
|
|
public partial class FormNeueAufgabe : Form
|
|
{
|
|
public Aufgabe aufgabe;
|
|
public FormNeueAufgabe()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
public FormNeueAufgabe(string v) :this()
|
|
{
|
|
if (v == "NeuerFahrer")
|
|
{
|
|
this.groupBoxNeueAufgabe.Visible = false;
|
|
this.Text = "Neuen Fahrer anlegen";
|
|
}
|
|
if (v == "NeueAufgabe")
|
|
{
|
|
this.groupBoxNeuerFahrer.Visible = false;
|
|
this.Text = "Neue Aufgabe anlegen";
|
|
}
|
|
|
|
}
|
|
|
|
private void buttonSpeichern_Click(object sender, EventArgs e)
|
|
{
|
|
if (aufgabe == null) this.aufgabe = new Aufgabe();
|
|
this.aufgabe.Bezeichnung = this.textBoxBezeichnung.Text;
|
|
this.aufgabe.Beschreibung = this.textBoxBeschreibung.Text;
|
|
|
|
if (aufgabe.Save() == 1)
|
|
{
|
|
this.DialogResult = DialogResult.OK;
|
|
this.Close();
|
|
}
|
|
|
|
}
|
|
private void buttonAbbrechen_Click(object sender, EventArgs e)
|
|
{
|
|
this.DialogResult = DialogResult.Cancel;
|
|
this.Close();
|
|
}
|
|
}
|
|
}
|