141 lines
3.0 KiB
C#
141 lines
3.0 KiB
C#
///////////////////////////////////////////////////////////
|
|
// Bool.cs
|
|
// Implementation of Class IntegrationExistanceChecker
|
|
// CSLA type: Read-only object
|
|
// Created on: 10-Feb-2005
|
|
// Object design: John
|
|
// Coded: John 10-Feb-2005
|
|
///////////////////////////////////////////////////////////
|
|
|
|
using System;
|
|
using System.Data;
|
|
using CSLA.Data;
|
|
using GZTW.Data;
|
|
using CSLA;
|
|
using System.Threading;
|
|
using CSLA.Security;
|
|
using System.ComponentModel;
|
|
|
|
|
|
|
|
namespace GZTW.AyaNova.BLL
|
|
{
|
|
/// <summary>
|
|
///Confirms the presence of an integration
|
|
///in the AyaNova database
|
|
/// </summary>
|
|
[Serializable,EditorBrowsable(EditorBrowsableState.Never)]
|
|
internal class IntegrationExistanceChecker : ReadOnlyBase
|
|
{
|
|
|
|
#region Attributes
|
|
private bool mExists;
|
|
private Guid mInternalID;//case 1981
|
|
#endregion
|
|
|
|
//Two properties case 1981
|
|
internal bool Exists
|
|
{
|
|
get
|
|
{
|
|
return mExists;
|
|
}
|
|
}
|
|
|
|
internal Guid InternalID
|
|
{
|
|
get
|
|
{
|
|
return mInternalID;
|
|
}
|
|
|
|
}
|
|
|
|
#region Constructor
|
|
|
|
/// <summary>
|
|
/// Private constructor to prevent direct instantiation
|
|
/// </summary>
|
|
private IntegrationExistanceChecker()
|
|
{
|
|
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region Static methods
|
|
|
|
|
|
|
|
|
|
internal static bool IntegrationExists(Guid IntegrationAppID)
|
|
{
|
|
|
|
return ((IntegrationExistanceChecker)DataPortal.Fetch(new Criteria(IntegrationAppID ))).mExists;
|
|
|
|
}
|
|
|
|
|
|
//added for case 1981
|
|
internal static IntegrationExistanceChecker IntegrationExistsEx(Guid IntegrationAppID)
|
|
{
|
|
|
|
return (IntegrationExistanceChecker)DataPortal.Fetch(new Criteria(IntegrationAppID));
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region DAL DATA ACCESS
|
|
///
|
|
/// <param Bool="Criteria"></param>
|
|
protected override void DataPortal_Fetch(object Criteria)
|
|
{
|
|
Criteria crit = (Criteria)Criteria;
|
|
|
|
Guid internalId=DBUtil.ToGuid(DBUtil.GetScalarFromSQLString(
|
|
"SELECT AID FROM aIntegration WHERE " +
|
|
"(AAPPID = @ID)", crit.IntegrationAppID
|
|
));
|
|
|
|
if (DBUtil.ToGuid(DBUtil.GetScalarFromSQLString(
|
|
"SELECT AAPPID FROM aIntegration WHERE " +
|
|
"(AAPPID = @ID)", crit.IntegrationAppID
|
|
)) == Guid.Empty)
|
|
this.mExists = false;
|
|
else
|
|
{
|
|
this.mExists = true;
|
|
this.mInternalID = internalId;//case 1981
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region criteria
|
|
/// <summary>
|
|
/// Criteria for identifying existing object
|
|
/// </summary>
|
|
[Serializable]
|
|
private class Criteria
|
|
{
|
|
|
|
public Guid IntegrationAppID;
|
|
|
|
public Criteria( Guid _IntegrationAppID)
|
|
{
|
|
IntegrationAppID=_IntegrationAppID;
|
|
|
|
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
}//end class
|
|
|
|
}//end namespace GZTW.AyaNova.BLL |