日期:2014-05-17 浏览次数:21005 次
public partial class Personnel
{
static volatile Personnel _instance = null;
static readonly object Padlock = new object();
private readonly DaoManager _daoManager = null;
private readonly ICommonDao _commonDao = null;
private Personnel()
{
_daoManager = ServiceConfig.GetInstance().DaoManager;
_commonDao = _daoManager[typeof(ICommonDao)] as ICommonDao;
}
/// <summary>
/// 获取单一实例
/// </summary>
/// <returns></returns>
public static Personnel GetInstance()
{
if (_instance == null)
{
lock (Padlock)
{
if (_instance == null)
{
_instance = new Personnel();
}
}
}
return _instance;
}
}
public partial class Personnel
{
private static Personnel _instance = new Personnel () ;
static readonly object Padlock = new object();
private readonly DaoManager _daoManager = null;
private readonly ICommonDao _commonDao = null;
private Personnel()
&nbs