private bool CanContinue() { if (IsDirty() || lblIsDirty.Visible) { DialogResult dr = MsgBox.Show("您未儲存目前資料,是否要儲存?", Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (dr == DialogResult.Cancel) { CurrentItem.RaiseClick(); return(false); } else if (dr == DialogResult.Yes) { AssessmentSetupRecord rec = CurrentItem.Tag as AssessmentSetupRecord; if (rec != null) { SaveAssessmentSetupToDB(rec.ID); } if (!SaveTemplate()) { CurrentItem.RaiseClick(); return(false); } //ReloadTempalte(CurrentItem); } } return(true); }
private bool CanContinue() { if (IsDirty()) { DialogResult dr = MsgBox.Show("您未儲存目前資料,是否要儲存?", Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (dr == DialogResult.Cancel) { CurrentItem.RaiseClick(); return(false); } else if (dr == DialogResult.Yes) { if (!SaveTemplate()) { CurrentItem.RaiseClick(); return(false); } } else { lblIsDirty.Visible = false; } } return(true); }