using Apewer; using System; namespace Apewer.Source { /// 数据库引擎的执行结果。 public class Execute : IExecute { private bool _success = false; private int _rows = 0; private string _error = ""; private string _message = ""; private Exception _exception = new Exception(); /// 语句执行成功。 public bool Success { get { return _success; } set { _success = value; } } /// 执行失败时的异常。 public Exception Exception { get { return _exception; } set { _exception = value; } } /// 受影响的行数。 public int Rows { get { return _rows; } set { _rows = value; } } /// 错误信息。 public string Error { get { if (!string.IsNullOrEmpty(_error)) { return _error; } else { if (_exception != null) { try { return _exception.Message; } catch { return _exception.GetType().FullName; } } } return ""; } set { _error = value ?? ""; } } /// 消息。 public string Message { get { return _message ?? ""; } set { _message = value ?? ""; } } } }