Ejemplo n.º 1
0
        private void Delete_Click(object sender, EventArgs e)
        {
            DialogResult confirmation = MessageBox.Show("Are you sure?", "sure?", MessageBoxButtons.YesNo);

            if (confirmation == DialogResult.Yes)
            {
                try
                {
                    ListViewItem item = listViewActivity.SelectedItems[0];
                    SomerenLogic.Activity_Service activity_Service = new Activity_Service();
                    activity_Service.Delete(int.Parse(item.Text));
                }
                catch (ArgumentOutOfRangeException)
                {
                    MessageBox.Show("Select an item");
                    return;
                }
            }
            showPanel("Activity");
        }