⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bankbecomp.cs

📁 基于DotNet的开源工作流引擎
💻 CS
字号:
using Castle.Services.Transaction;
using Castle.Facilities.NHibernateIntegration;
using NetBpm.Util.DB;

namespace NetBpm.Test.Bank.EComp.Impl
{
	[Transactional]
	public class BankBEComp : AbstractBank, IBankB
	{
		public BankBEComp(ISessionManager sessionManager) : base(sessionManager)
		{
		}

		override public string GetName()
		{
			return "BankB"; 
		}

		[Transaction(TransactionMode.Requires)]
		public void DeposidMoney(string name,float money)
		{
			DbSession dbSession = null;
			try
			{
				dbSession = OpenSession();
				instance.Deposid(GetName(),name,money,dbSession);
				// Ohhhh I forgot the rules ;-)
				if (money<0)
				{
					throw new AccountException("it is not allowed to transfer a negative amount of money!");
				}
			}
			finally
			{
				if (dbSession!=null)
				{
					dbSession.Close();
				}
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -