private void FrmUserAdmin_FormClosing(object sender, FormClosingEventArgs e) { if (BaseInterfaceLogic.IsModfiedAnyOne(this.DTUser)) { // 数据有变动是否保存的提示 DialogResult dialogResult = MessageBox.Show(AppMessage.MSG0045, AppMessage.MSG0000, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3); if (dialogResult == DialogResult.Cancel) { e.Cancel = true; } else if (dialogResult == DialogResult.Yes) { // 保存数据 this.BatchSave(); } } }
/// <summary> /// 数据是否被修改过 /// </summary> /// <returns>是否修改过</returns> private bool IsModfied() { return(BaseInterfaceLogic.IsModfiedAnyOne(this.DTItemDetails)); }