private void btnSave_Click(object sender, EventArgs e) { int count = 0; foreach (Course each in _courses.Values) { count += each.SCAttends.Count; } string message = string.Format("您確定要儲存計算結果?儲存時可能需要較長的時間。(成績筆數:{0})", count); DialogResult dr = MsgBox.Show(message, Application.ProductName, MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { CalculateProgress progress = new CalculateProgress(_courses); DialogResult dr1 = progress.ShowDialog(); if (dr1 == DialogResult.OK) { MsgBox.Show(string.Format("儲存完成。", count), Application.ProductName); } DialogResult = dr1; } else { DialogResult = DialogResult.None; } }
private void btnClearData_Click(object sender, EventArgs e) { CalculateProgress progress = new CalculateProgress(_courses); progress.ClearData = true; progress.ShowDialog(); }