private void btnAddNew_Click(object sender, EventArgs e) { frmStatistics_SingleForm form = new frmStatistics_SingleForm(null, null); if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.InitStatisticsGroup(); } }
private void btnUpdate_Click(object sender, EventArgs e) { if (this.dgvData.SelectedRows.Count == 0) { MessageBox.Show("請選擇待修改項目。"); return; } if (this.dgvData.SelectedRows.Count > 1) { MessageBox.Show("僅能單筆刪除。"); return; } UDT.Survey Survey = this.dgvData.SelectedRows[0].Cells[0].Tag as UDT.Survey; UDT.StatisticsGroup StatisticsGroup = this.dgvData.SelectedRows[0].Tag as UDT.StatisticsGroup; frmStatistics_SingleForm form = new frmStatistics_SingleForm(StatisticsGroup, Survey); if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.InitStatisticsGroup(); } }