private void buttonX6_Click(object sender, EventArgs e) { // 檢查勾選學生人數 int checkSelectCount = 0; List <XmlElement> list = new List <XmlElement>(); foreach (ListViewItem var in listView2.Items) { if (var.Checked) { list.Add((XmlElement)var.Tag); checkSelectCount++; } } // 當沒有勾選學生 if (checkSelectCount == 0) { FISCA.Presentation.Controls.MsgBox.Show("請勾選學生.."); return; } UpdateRecordBatch.InsertUpdateRecordBatch(txtNameListName.Text, comboBoxEx1.Text, comboBoxEx2.Text, _NameListProvider.CreateNameList(comboBoxEx1.Text, comboBoxEx2.Text, list)); //_NameListProvider.CreateNameList(comboBoxEx1.Text, comboBoxEx2.Text, list).OwnerDocument.Save("D:\\1234.xml"); this.DialogResult = DialogResult.OK; this.Close(); }
private void buttonX6_Click(object sender, EventArgs e) { List <XmlElement> list = new List <XmlElement>(); foreach (ListViewItem var in listView2.Items) { if (var.Checked) { list.Add((XmlElement)var.Tag); } } try { UpdateRecordBatch.InsertUpdateRecordBatch(txtNameListName.Text, comboBoxEx1.Text, comboBoxEx2.Text, _NameListProvider.CreateNameList(comboBoxEx1.Text, comboBoxEx2.Text, list)); } catch (Exception ex) { FISCA.Presentation.Controls.MsgBox.Show("產生名冊XML發生錯誤" + ex.Message); } //_NameListProvider.CreateNameList(comboBoxEx1.Text, comboBoxEx2.Text, list).OwnerDocument.Save("D:\\1234.xml"); this.DialogResult = DialogResult.OK; this.Close(); }