Esempio n. 1
0
 private void btnVeranderTotaal_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedIndices.Count == 1)
     {
         int          selectedIdx = listView1.SelectedIndices[0];
         Artikel      art         = m.getArtikelen()[selectedIdx];
         string       verm        = art.getTotaal().ToString();
         DialogResult result      = MsgBoxes.InputBox("Nieuwe totaalprijs?", "Wat is de nieuwe totaalprijs?", ref verm);
         if (result == DialogResult.OK)
         {
             float cash1 = float.Parse(verm, new CultureInfo("en-US"));
             float cash2 = float.Parse(verm, new CultureInfo("nl-NL"));
             float cash  = (cash1 > cash2 ? cash2 : cash1);
             art.setTotaal(cash);
             updateListView();
         }
     }
     else
     {
         string       verm   = m.getGrandTotal().ToString();
         DialogResult result = MsgBoxes.InputBox("Nieuwe totaalprijs?", "Wat is de nieuwe totaalprijs?", ref verm);
         if (result == DialogResult.OK)
         {
             float cash1 = float.Parse(verm, new CultureInfo("en-US"));
             float cash2 = float.Parse(verm, new CultureInfo("nl-NL"));
             float cash  = (cash1 > cash2 ? cash2 : cash1);
             m.setGrandTotal(cash);
             lblTotaal.Text      = m.getGrandTotal().ToString("c2");
             lblTotaalKlant.Text = m.getGrandTotal().ToString("c2");
         }
     }
     txtBARcode.Focus();
 }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult result = MsgBoxes.DialogBox("Afsluiten?", "De applicatie wordt beëindigd.\nZeker weten?");

            if (result == DialogResult.Yes)
            {
                db.closeConnection();
                Application.Exit();
            }
            txtBARcode.Focus();
        }
Esempio n. 3
0
        private void btnMultiplicity_Click(object sender, EventArgs e)
        {
            string       verm   = "1";
            DialogResult result = MsgBoxes.InputBox("Vermenigvuldiging", "Vul het aantal in van het volgende artikel...", ref verm);

            if (result == DialogResult.OK && int.Parse(verm) > 0)
            {
                m.setVermenigvuldiging(int.Parse(verm));
            }
            txtBARcode.Focus();
        }
Esempio n. 4
0
        private void btnHandBarCode_Click(object sender, EventArgs e)
        {
            string       code   = "";
            DialogResult result = MsgBoxes.InputBox("BAR-Code", "Vul de BAR-Code in van het toe te voegen artikel...", ref code);

            if (result == DialogResult.OK)
            {
                m.addArtikel(db.getArtikelByBarCode(code));
                updateListView();
            }
            txtBARcode.Focus();
        }
Esempio n. 5
0
 private void btnVerwijder_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedIndices.Count == 1)
     {
         int          selectedIdx = listView1.SelectedIndices[0];
         DialogResult result      = MsgBoxes.DialogBox("Verwijderen?", "Het artikel wordt verwijderd.\nZeker weten?");
         if (result == DialogResult.Yes)
         {
             m.removeFromArtikelen(selectedIdx);
             updateListView();
         }
     }
     txtBARcode.Focus();
 }
Esempio n. 6
0
        private void btnPin_Click(object sender, EventArgs e)
        {
            string       verm   = "0";
            DialogResult result = MsgBoxes.InputBox("Hoeveel Cash?", "Voor hoeveel wil de klant met Cash betalen?", ref verm);

            if (result == DialogResult.OK)
            {
                float cash1 = float.Parse(verm, new CultureInfo("en-US"));
                float cash2 = float.Parse(verm, new CultureInfo("nl-NL"));
                float pin   = m.getGrandTotal() - (cash1 > cash2 ? cash2 : cash1);
                MsgBoxes.DialogBoxOk("Nog te Pinnen...", "Het bedrag nog te pinnen is:\n\n            " + pin.ToString("c2"));
            }
            txtBARcode.Focus();
        }
Esempio n. 7
0
        private void btnCash_Click(object sender, EventArgs e)
        {
            string       verm   = m.getGrandTotal().ToString();
            DialogResult result = MsgBoxes.InputBox("Hoeveel Cash?", "Met hoeveel heeft de kant betaald?", ref verm);

            if (result == DialogResult.OK)
            {
                float cash1  = float.Parse(verm, new CultureInfo("en-US"));
                float cash2  = float.Parse(verm, new CultureInfo("nl-NL"));
                float cash   = (cash1 > cash2 ? cash2 : cash1);
                float change = cash - m.getGrandTotal();
                MsgBoxes.DialogBoxOk("Wisselgeld...", "Het wisselgeld is:\n\n            " + change.ToString("c2"));
            }
            txtBARcode.Focus();
        }
Esempio n. 8
0
 private void btnVeranderAantal_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedIndices.Count == 1)
     {
         int          selectedIdx = listView1.SelectedIndices[0];
         Artikel      art         = m.getArtikelen()[selectedIdx];
         string       verm        = art.getAantal().ToString();
         DialogResult result      = MsgBoxes.InputBox("Nieuw aantal?", "Wat is het nieuwe artikelaantal?", ref verm);
         if (result == DialogResult.OK)
         {
             art.setAantal(int.Parse(verm));
             updateListView();
         }
     }
     txtBARcode.Focus();
 }
Esempio n. 9
0
        private void btnNieuweKlant_Click(object sender, EventArgs e)
        {
            DialogResult result = MsgBoxes.DialogBox("Volgende Klant?", "Het huidige overzicht wordt gereset.\nZeker weten?");

            if (result == DialogResult.Yes)
            {
                m.resetArtikelen();
                listView1.Items.Clear();
                lblTotaal.Text = 0.ToString("c2");
                if (klantViewRunning)
                {
                    listViewKlant.Items.Clear();
                    lblTotaalKlant.Text = 0.ToString("c2");
                }
            }
            txtBARcode.Focus();
        }
Esempio n. 10
0
        private void btnHandArtOm_Click(object sender, EventArgs e)
        {
            string       code   = "";
            DialogResult result = MsgBoxes.InputBox("Omschrijving", "Vul (een deel van) de omschrijving in van het toe te voegen artikel...", ref code);

            if (result == DialogResult.OK)
            {
                Collection <Artikel> artikelen = db.getArtikelen(code);
                int selectedIdx = -1;
                result = MsgBoxes.ListBox("Resultaten", "Selecteer een van onderstaande resultaten...", ref selectedIdx, ref artikelen);
                if (result == DialogResult.OK && selectedIdx != -1)
                {
                    m.addArtikel(artikelen[selectedIdx]);
                    updateListView();
                }
            }
            txtBARcode.Focus();
        }