private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (CurrentItem == null)
                {
                    return;
                }

                string msg = "確定要刪除「" + (CurrentItem.Tag as AssessmentSetupRecord).Name + "」評量設定?\n";
                msg += "刪除後,使用此評量設定的「課程」將會自動變成未設定評量設定狀態。";

                DialogResult dr = MsgBox.Show(msg, Application.ProductName, MessageBoxButtons.YesNo);

                if (dr == DialogResult.Yes)
                {
                    AssessmentSetupRecord        record  = CurrentItem.Tag as AssessmentSetupRecord;
                    List <AEIncludeRecordEditor> editors = new List <AEIncludeRecordEditor>();
                    foreach (var item in record.GetAEIncludes())
                    {
                        AEIncludeRecordEditor editor = item.GetEditor();
                        editor.Remove = true;
                        editors.Add(editor);
                    }
                    if (editors.Count > 0)
                    {
                        editors.SaveAllEditors();
                    }

                    AssessmentSetupRecordEditor ASEditor = record.GetEditor();
                    ASEditor.Remove = true;
                    ASEditor.Save();
                }
            }
            catch (Exception ex)
            {
                MsgBox.Show(ex.Message);
                //CurrentUser.ReportError(ex);
            }
        }
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtTemplateName.Text.Trim()))
            {
                MsgBox.Show("您必須輸入名稱。");
                DialogResult = DialogResult.None;
                return;
            }

            if (ContainsTemplateName(txtTemplateName.Text.Trim()) && txtTemplateName.Text.Trim() != _orig_name)
            {
                MsgBox.Show("名稱重覆,請選擇其他名稱。");
                DialogResult = DialogResult.None;
                txtTemplateName.SelectAll();
                return;
            }

            if (txtTemplateName.Text.Trim() != _orig_name)
            {
                AssessmentSetupRecordEditor editor;
                if (_record == null) //Insert
                {
                    editor = AssessmentSetup.Instance.AddAssessmentSetup();
                }
                else
                {
                    editor = _record.GetEditor();
                }
                editor.Name = txtTemplateName.Text.Trim();

                AssessmentSetup.Instance.ItemUpdated += new EventHandler <ItemUpdatedEventArgs>(Instance_ItemUpdated);
                editor.Save();

                DialogResult = DialogResult.OK;
            }
        }