Example #1
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            if (itmPnlQuizName.SelectedItems.Count == 1)
            {
                ButtonItem selItm = itmPnlQuizName.SelectedItems[0] as ButtonItem;
                if (selItm != null)
                {
                    if (FISCA.Presentation.Controls.MsgBox.Show("請問確定刪除[" + selItm.Name + "]?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Yes)
                    {
                        DAO.UDT_QuizDef data = itmPnlQuizName.SelectedItems[0].Tag as DAO.UDT_QuizDef;

                        string        itemName = "";
                        List <string> itemList = (from da in Utility.ConvertStringToXelm1(data.QuizDataField).Elements("Field") select da.Attribute("name").Value).ToList();
                        itemName += string.Join(",", itemList.ToArray());
                        _LogTransfer.SetLogValue("測驗名稱", data.QuizName);
                        _LogTransfer.SetLogValue("項目內容", itemName);
                        _LogTransfer.SaveDeleteLog("輔導刪除測驗", "刪除", "", "", "", "");

                        _UDTTransfer.DeleteQuizData(data);
                        LoadData();
                    }
                }
            }
        }