Projekte werden jetzt angezeigt
This commit is contained in:
43
SanSystem/frmProjektList.cs
Normal file
43
SanSystem/frmProjektList.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace SanSystem
|
||||
{
|
||||
public partial class frmProjektList : Form
|
||||
{
|
||||
public frmProjektList()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void frmProjektList_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
foreach(DirectoryInfo projekte in (new DirectoryInfo("./projekte").GetDirectories()))
|
||||
{
|
||||
lb_projekte.Items.Add(projekte.Name);
|
||||
}
|
||||
}
|
||||
|
||||
private void btn_ok_Click(object sender, EventArgs e)
|
||||
{
|
||||
string projekt = (string)lb_projekte.SelectedItem;
|
||||
if (projekt == null) return;
|
||||
|
||||
if(Database.Datenbank.Instance.projekt != projekt)
|
||||
{
|
||||
Database.Datenbank.Instance.SaveProjekt();
|
||||
Database.Datenbank.Instance.LoadProjekt(projekt, Global.Instance.Projektpfad);
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user