Files
Kanalsanierungsverwaltung/SanSystem/frmProjektList.cs
2018-07-11 21:55:46 +02:00

44 lines
1.1 KiB
C#

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();
}
}
}