using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using CoreFS.CA06; namespace Core.StlMes.Client.Sale.DbHelp { public class DbTransaction:DbBase { private CoreFS.CA06.OpeBase _ob = null; private Core.StlMes.Client.Sale.DbHelp.DbExecute dbExecute = null; private const string ServerName = "core.stlmes.server.sale.dbhelp.DbManager"; private const string BeginTransactionMethod = "beginTransaction"; private const string CommitMethod = "commit"; private const string RollbackMethod = "rollBack"; private string uuid = ""; public string Uuid { get { return this.uuid; } set { this.uuid = value; } } public string _errMsg = ""; public string ErrMsg { get { return this._errMsg; } set { this._errMsg = value; } } public DbTransaction(CoreFS.CA06.OpeBase ob) { this._ob = ob; dbExecute = new DbExecute(ob); } public void BeginTransaction() { CoreClientParam pa = dbExecute.GetUuid(); if (pa == null) { this.ErrMsg = " 无法获取连接!!!! "; return; } this.uuid = pa.ReturnObject.ToString(); this.ErrMsg = (this.uuid.Length == 0) ? " 无法获取连接!!!! " : ""; } public void Commit() { if (this.ErrMsg.Length > 0) { RollBack(); return; } dbExecute.Commit(this.Uuid); } public void RollBack() { dbExecute.RollBack(this.Uuid); } } }