Ejemplo n.º 1
0
        private void btnRemoveStudent_Click(object sender, EventArgs e)
        {
            List <DAO.UDT_CounselStudent_ListDef> DelList = new List <DAO.UDT_CounselStudent_ListDef>();

            if (lvStudentList.SelectedItems.Count > 0)
            {
                foreach (ListViewItem lvi in lvStudentList.SelectedItems)
                {
                    DAO.UDT_CounselStudent_ListDef data = lvi.Tag as DAO.UDT_CounselStudent_ListDef;
                    if (data == null)
                    {
                        continue;
                    }

                    DelList.Add(data);
                }
                if (DelList.Count > 0)
                {
                    if (FISCA.Presentation.Controls.MsgBox.Show("確定移除" + DelList.Count + "位學生?", "移除所選學生", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                    {
                        _UDTTransfer.DeleteCounselStudentList(DelList);
                        _bgWorker.RunWorkerAsync();
                    }
                }
            }
            else
            {
                FISCA.Presentation.Controls.MsgBox.Show("請選擇資料.");
            }
        }