115 lines
2.9 KiB
C#
115 lines
2.9 KiB
C#
///////////////////////////////////////////////////////////
|
|
// Bool.cs
|
|
// Implementation of Class ClientServiceRequestNameFetcher
|
|
// CSLA type: Read-only object
|
|
// Created on: 2-Nov-2007
|
|
// Object design: John
|
|
// Coded: 2-Nov-2007
|
|
///////////////////////////////////////////////////////////
|
|
|
|
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>
|
|
///Returns service bankable object most responsible
|
|
/// for banking based on client
|
|
/// </summary>
|
|
[Serializable, EditorBrowsable(EditorBrowsableState.Never)]
|
|
internal class ClientServiceRequestNameFetcher : ReadOnlyBase
|
|
{
|
|
|
|
#region Attributes
|
|
private string description;
|
|
|
|
#endregion
|
|
|
|
#region Constructor
|
|
|
|
/// <summary>
|
|
/// Private constructor to prevent direct instantiation
|
|
/// </summary>
|
|
private ClientServiceRequestNameFetcher()
|
|
{
|
|
description = "";
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region Static methods
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Get a description for a CSR to display in lists in UI
|
|
/// </summary>
|
|
/// <param name="ID"></param>
|
|
/// <returns></returns>
|
|
internal static string Description(Guid ID)
|
|
{
|
|
|
|
return ((ClientServiceRequestNameFetcher)DataPortal.Fetch(new Criteria(ID))).description;
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
#region DAL DATA ACCESS
|
|
///
|
|
/// <param Bool="Criteria"></param>
|
|
protected override void DataPortal_Fetch(object Criteria)
|
|
{
|
|
Criteria crit = (Criteria)Criteria;
|
|
SafeDataReader dr = null;
|
|
try
|
|
{
|
|
dr = DBUtil.GetReaderFromSQLString(
|
|
"SELECT ACLIENTSERVICEREQUEST.ATITLE, ACLIENT.ANAME FROM " +
|
|
"ACLIENTSERVICEREQUEST " +
|
|
"LEFT JOIN ACLIENT " +
|
|
"ON ( ACLIENT.AID = ACLIENTSERVICEREQUEST.ACLIENTID ) " +
|
|
"WHERE ACLIENTSERVICEREQUEST.AID= @ID", crit.ID);
|
|
if (dr.Read())
|
|
{
|
|
description = dr.GetString("ANAME") + " \"" + dr.GetString("ATITLE") + "\"";
|
|
}
|
|
}
|
|
finally
|
|
{
|
|
if (dr != null) dr.Close();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region criteria
|
|
/// <summary>
|
|
/// Criteria for identifying existing object
|
|
/// </summary>
|
|
[Serializable]
|
|
private class Criteria
|
|
{
|
|
public Guid ID;
|
|
public Criteria(Guid _ID)
|
|
{
|
|
ID = _ID;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
}//end class
|
|
|
|
}//end namespace GZTW.AyaNova.BLL |