Пример #1
0
        private void ucButtonRemove_Click(object sender, System.EventArgs e)
        {
            ArrayList array = new ArrayList();

            foreach (ListViewItem deletedItem in this.listViewSelected.SelectedItems)
            {
                if (_TSFacade.HasInfoBelowTSErrorCode((TSErrorCode)deletedItem.Tag))
                {
                    array.Add(deletedItem.Text);
                }
            }

            if (array.Count > 0)
            {
                string msg = "不良代码组:不良代码已经维护有维修信息,是否确定删除?\n";

                foreach (string code in array)
                {
                    msg += code + "\n";
                }

                if (MessageBox.Show(msg, this.Text, MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
            }

            foreach (ListViewItem deletedItem in this.listViewSelected.SelectedItems)
            {
                _ListHelper.Delete((TSErrorCode)deletedItem.Tag);
                deletedItem.Remove();
            }
        }