Beispiel #1
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            int theIndex = 0;

            theIndex = lstBrowse.FocusedItem.Index;

            // First sub item is wallet number.
            int Id = 0;

            Id = int.Parse(lstBrowse.Items[theIndex].SubItems[0].Text);

            DialogResult result = MessageBox.Show("Are you sure you wish to delete the selected collector?", ModuleGeneric.getAppShortName(), MessageBoxButtons.YesNo);

            if (result == DialogResult.No)
            {
                return;
            }
            else if (result == DialogResult.Yes)
            {
                if (!serviceLayer.DeleteCollector(serviceLayer.GetCollector(Id)))
                {
                    Interaction.MsgBox("Error: Failed to delete collector!");
                }
                else
                {
                    Interaction.MsgBox("Successfully deleted collector.");
                }
            }

            refreshList();
        }