190 lines
3.9 KiB
C#
190 lines
3.9 KiB
C#
///////////////////////////////////////////////////////////
|
|
// UserListCertifications.cs
|
|
// Implementation of Class UserListCertifications
|
|
// CSLA type: Read only collection
|
|
// Created on: 23-Jan-2005
|
|
// Object design: John
|
|
// Coded: 23-Jan-2005
|
|
///////////////////////////////////////////////////////////
|
|
|
|
using System;
|
|
using System.Data;
|
|
using GZTW.Data;
|
|
using CSLA.Data;
|
|
using CSLA;
|
|
|
|
namespace GZTW.AyaNova.BLL
|
|
{
|
|
#pragma warning disable 1591
|
|
|
|
/// <summary>
|
|
/// Used internally for Schedule user groups form
|
|
///
|
|
/// </summary>
|
|
[Serializable]
|
|
public class UserListCertifications : ReadOnlyCollectionBase
|
|
{
|
|
#region Data structure
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
[Serializable]
|
|
public struct UserListCertificationsInfo
|
|
{
|
|
|
|
internal Guid mUserID;
|
|
internal Guid mCertificationID;
|
|
|
|
|
|
|
|
//Public properties
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public Guid UserID {get{return mUserID;}}
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public Guid CertificationID {get{return mCertificationID;}}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="obj"></param>
|
|
public bool Equals(UserListCertificationsInfo obj)
|
|
{
|
|
return (this.mUserID==obj.mUserID && this.CertificationID==obj.mCertificationID);
|
|
|
|
}
|
|
|
|
}//end UserListCertificationsInfo
|
|
#endregion
|
|
|
|
#region Constructor
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
protected UserListCertifications()
|
|
{
|
|
// AllowSort=false;
|
|
// AllowFind=true;
|
|
// AllowEdit=false;
|
|
// AllowNew=false;
|
|
// AllowRemove=false;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Business properties and methods
|
|
|
|
/// <summary>
|
|
/// Get item by index
|
|
/// </summary>
|
|
/// <param name="Item"></param>
|
|
public UserListCertificationsInfo this[int Item]
|
|
{
|
|
|
|
get
|
|
{
|
|
return (UserListCertificationsInfo) List[Item];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region contains
|
|
// /// <summary>
|
|
// /// Check if item in collection
|
|
// /// </summary>
|
|
//
|
|
// /// <param name="obj"></param>
|
|
// public bool Contains(UserListCertificationsInfo obj)
|
|
// {
|
|
// foreach (UserListCertificationsInfo child in List)
|
|
// {
|
|
// if(child.Equals(obj)) return true;
|
|
// }
|
|
// return false;
|
|
//
|
|
// }
|
|
#endregion
|
|
|
|
#region Static methods
|
|
/// <summary>
|
|
/// Get all scheduleable users
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
|
|
public static UserListCertifications GetList()
|
|
{
|
|
return (UserListCertifications) DataPortal.Fetch(new Criteria());
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region DAL DATA ACCESS
|
|
///
|
|
/// <param name="Criteria"></param>
|
|
protected override void DataPortal_Fetch(object Criteria)
|
|
{
|
|
|
|
SafeDataReader dr = null;
|
|
try
|
|
{
|
|
dr=DBUtil.GetReaderFromSQLString(
|
|
//************************************************************
|
|
"SELECT aUserID, aUserCertificationID FROM aUserCertificationAssigned"
|
|
//************************************************************
|
|
);
|
|
|
|
while(dr.Read())
|
|
{
|
|
//*******************************************
|
|
UserListCertificationsInfo info=new UserListCertificationsInfo();
|
|
info.mUserID=dr.GetGuid("aUserID");
|
|
info.mCertificationID=dr.GetGuid("aUserCertificationID");
|
|
InnerList.Add(info);
|
|
//*******************************************
|
|
}
|
|
}
|
|
finally
|
|
{
|
|
if(dr!=null) dr.Close();
|
|
}
|
|
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region criteria
|
|
/// <summary>
|
|
/// Criteria for identifying existing object
|
|
/// </summary>
|
|
[Serializable]
|
|
private class Criteria
|
|
{
|
|
|
|
|
|
//public Guid VendorID;
|
|
|
|
public Criteria( )
|
|
{
|
|
//VendorID=_VendorID;
|
|
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
}//end UserListCertifications
|
|
#pragma warning restore 1591
|
|
}//end namespace GZTW.AyaNova.BLL |