Ejemplo n.º 1
0
 private void btnTorles_Click(object sender, EventArgs e)
 {
     if (lvTermekek.SelectedIndices.Count > 0)
     {
         if (MessageBox.Show("Biztos törlöd a terméket ?", "Kérdés", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
         {
             Termek t = null;
             string a;
             int    index      = -1;
             int    firstIndex = lvTermekek.SelectedIndices[0];
             a     = lvTermekek.Items[firstIndex].SubItems[0].Text;
             index = Convert.ToInt32(a);
             if (index > -1)
             {
                 foreach (Termek item in termek)
                 {
                     if (item.TermekID == index)
                     {
                         t = item;
                     }
                 }
             }
             ABKezeloTermek.TermekTorles(t);
             termek.Remove(t);
             LvTermekeFeltolt();
         }
     }
 }