public BezoekForm(MainForm m, Administratie a, Project p, bool fullkaart) { InitializeComponent(); mainform = m; admin = a; project = p; this.fullkaart = fullkaart; refresh = true; // De kaart van het gebied laden foreach (Gebied g in admin.Gebieden) { if (project.GebiedID == g.ID) { pnlKaart.BackgroundImage = Image.FromFile(g.KaartPath); pnlKaart.BackgroundImageLayout = ImageLayout.Stretch; } } // Comboboxes vullen cbxVogelSoort.DataSource = admin.Diersoorten; cbxWaarneming.DataSource = Enum.GetNames(typeof(CSharp.Type)); // Een nieuw bezoek starten int bezoekid = 1; if (p.Bezoeken != null) { foreach (Bezoek b in p.Bezoeken) { bezoekid++; } } bezoek = new Bezoek(bezoekid, p.ID, DateTime.Now); p.AddBezoek(bezoek); // Comboboxen disablen wanneer alleen de kaart bekeken wordt cbxVogelSoort.Enabled = true; cbxWaarneming.Enabled = true; if (fullkaart) { cbxVogelSoort.Enabled = false; cbxWaarneming.Enabled = false; } }
public MainForm() { InitializeComponent(); //Database data = new Database(); IData data = SetDataSource(); try { admin = new Administratie(data); } catch (IOException e) { MessageBox.Show(e.Message); Environment.Exit(0); } catch (OracleException e) { MessageBox.Show(e.Message); Environment.Exit(0); } cbxGebied.DataSource = admin.Gebieden; }
public MainForm() { InitializeComponent(); admin = new Administratie(); VulDropdown(); }
public StartScherm() { InitializeComponent(); admin = new Administratie(); fill(); }