Пример #1
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            if (radioExisting.Checked) //Show login
            {
                frmLogin frmLogin = new frmLogin() { Location = Location, StartPosition = FormStartPosition.CenterParent };

                if (frmLogin.ShowDialog(this) == DialogResult.OK)
                {
                    Account = frmLogin.Account;
                }
                else
                {
                    MessageBox.Show("Geen geldig account, begin opnieuw.");
                    return;
                }
            }
            if (radioNew.Checked) //Show new
            {
                frmNewAccount frmAccount = new frmNewAccount() { Location = Location, StartPosition = FormStartPosition.CenterParent};

                if (frmAccount.ShowDialog(this) == DialogResult.OK)
                {
                    Account = frmAccount.Account;
                }
                else
                {
                    MessageBox.Show("Geen geldig account, begin opnieuw.");
                    return;
                }
            }

            frmDatum frmDatum = new frmDatum() { Location = Location, StartPosition = FormStartPosition.CenterParent };
            if (frmDatum.ShowDialog(this) != DialogResult.OK)
            {
                MessageBox.Show("Geen geldige datum ingevoerd. Probeer het opnieuw");
                return;
            }

            frmKaart frmKaart = new frmKaart() {Location = Location, StartPosition = FormStartPosition.CenterParent };

            if (frmKaart.ShowDialog(this) != DialogResult.OK)
            {
                MessageBox.Show("Geen plek gekozen! Probeer het opnieuw.");
                return;
            }
            frmSelectMaterial frmMaterial = new frmSelectMaterial(SelectedEvenement, frmDatum.From, frmDatum.Till) { Location = Location, StartPosition = FormStartPosition.CenterParent };
            if (frmMaterial.ShowDialog(this) == DialogResult.OK)
            {
                //TODO RICK FIX DEZE SHIZZLE
            }
            try
            {
                if (DatabaseManager.InsertItem(new LeasePlace()
                {
                    Account = Account.ID,
                    Arrival = frmDatum.From,
                    Departure = frmDatum.Till,
                    Event = SelectedEvenement.ID,
                    Place = frmKaart.SpotID
                }))
                {
                    MessageBox.Show("U bent aangemeld! RFID word klaar gezet", "Succes", MessageBoxButtons.OK,
                        MessageBoxIcon.Information);
                }

            }
            catch
            {
                Console.WriteLine("Error insterting item");
            }
        }
Пример #2
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            Evenement selectedEvenement = evenements[listEvents.SelectedIndex];
            frmSelectMaterial frmSelectMaterial = new frmSelectMaterial(selectedEvenement, frmDatum.From, frmDatum.Till);

            frmSelectMaterial.ShowDialog(this);
        }