Exemplo n.º 1
0
        private void frmPrijsberekening_Load(object sender, EventArgs e)
        {
            if (informatie != null)
            {
                txtAantalkm.Text        = informatie.aantalkm.ToString();
                cbbDagkost.SelectedItem = informatie.dagprijs_autocar;
                cbbKmprijs.SelectedItem = informatie.kmprijs_autocar;
                txtBTW.Text             = informatie.offerte_btw_bedrag.ToString();
                txtTotaal.Text          = informatie.offerte_totaal.ToString();
                txtWinstmarge.Text      = informatie.offerte_winst.ToString();
                txtVraagprijs.Text      = informatie.offerte_totaal.ToString();
                txtKostprijs.Text       = informatie.offerte_kostprijs.ToString();
                txtKorting.Text         = informatie.offerte_korting.ToString();

                foreach (kost kost in OfferteManagement.getKostenVanOfferte(informatie.opdracht_id))
                {
                    ucKost ucKost = new ucKost();
                    ucKost.omschrijving = kost.omschrijving;
                    ucKost.prijs        = kost.bedrag;

                    flpKosten.Controls.Add(ucKost);
                }

                foreach (loonsoort loonsoort in OfferteManagement.getLoonSoortenVanOfferte(informatie.opdracht_id))
                {
                    ucLoonSoort ucLoonSoort = new ucLoonSoort();
                    ucLoonSoort.loonsoort = loonsoort;
                    ucLoonSoort.dagen     = dagen.ToString();

                    flpLoonSoorten.Controls.Add(ucLoonSoort);
                }
            }
        }
Exemplo n.º 2
0
        private void btnAddLoonSoort_Click(object sender, EventArgs e)
        {
            ucLoonSoort ucLoonSoort = new ucLoonSoort();

            ucLoonSoort.dagen          = dagen;
            ucLoonSoort.OnButtonclick += new EventHandler(ucLoonSoort_OnButtonclick);
            flpLoonSoorten.Controls.Add(ucLoonSoort);

            btnBerekenBTW.Enabled = true;
        }
Exemplo n.º 3
0
        //Wat gebeurt er als er op de knop naast een loon geklikt wordt
        void ucLoonSoort_OnButtonclick(object sender, EventArgs e)
        {
            if (MessageBox.Show("Weet u zeker dat u deze loonsoort wilt verwijderen? Dit kan niet ongedaan worden", "Confirmatie", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                ucLoonSoort uc = sender as ucLoonSoort;

                int index = 0;

                foreach (ucLoonSoort ucLoonSoort in flpLoonSoorten.Controls)
                {
                    if (ucLoonSoort == uc)
                    {
                        flpLoonSoorten.Controls.RemoveAt(index);
                    }
                    index += 1;
                }
            }
        }