99 lines
1.8 KiB
C#
99 lines
1.8 KiB
C#
///////////////////////////////////////////////////////////
|
|
// Bool.cs
|
|
// Implementation of Class WorkorderCountFetcher
|
|
// CSLA type: Read-only object
|
|
// Created on: 21-Oct-2005
|
|
// Object design: John
|
|
// Coded: John 21-Oct-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>
|
|
/// Used to quickly fetch a count of all workorders
|
|
/// in database
|
|
/// </summary>
|
|
[Serializable,EditorBrowsable(EditorBrowsableState.Never)]
|
|
internal class WorkorderCountFetcher : ReadOnlyBase
|
|
{
|
|
|
|
#region Attributes
|
|
private long mCount;
|
|
|
|
#endregion
|
|
|
|
#region Constructor
|
|
|
|
/// <summary>
|
|
/// Private constructor to prevent direct instantiation
|
|
/// </summary>
|
|
private WorkorderCountFetcher()
|
|
{
|
|
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Static methods
|
|
|
|
|
|
/// <summary>
|
|
/// Counts workorders
|
|
/// </summary>
|
|
/// <returns>Count</returns>
|
|
public static long GetItem()
|
|
{
|
|
|
|
return ((WorkorderCountFetcher)DataPortal.Fetch(new Criteria( ))).mCount;
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
#region DAL DATA ACCESS
|
|
///
|
|
/// <param Bool="Criteria"></param>
|
|
protected override void DataPortal_Fetch(object Criteria)
|
|
{
|
|
mCount=System.Convert.ToInt64(DBUtil.GetScalarFromSQLString("SELECT COUNT(*) AS aquant FROM aWorkorder"));
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region criteria
|
|
/// <summary>
|
|
/// Criteria for identifying existing object
|
|
/// </summary>
|
|
[Serializable]
|
|
private class Criteria
|
|
{
|
|
|
|
|
|
|
|
public Criteria()
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
}//end Bool
|
|
|
|
}//end Boolspace GZTW.AyaNova.BLL |