Example #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();
 }
Example #2
0
 public void addArtikel(Artikel a)
 {
     if (a != null && a.getNr() != 0)
     {
         a.setAantal(vermenigvuldiging);
         Artikelen.Add(a);
         vermenigvuldiging = 1;
     }
 }
Example #3
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();
 }