This commit is contained in:
214
PROMS/proms/Volian.CSLA.Library/Generated/AssignmentInfoList.cs
Normal file
214
PROMS/proms/Volian.CSLA.Library/Generated/AssignmentInfoList.cs
Normal file
@@ -0,0 +1,214 @@
|
||||
// ========================================================================
|
||||
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
||||
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
// ------------------------------------------------------------------------
|
||||
// $Workfile: $ $Revision: $
|
||||
// $Author: $ $Date: $
|
||||
//
|
||||
// $History: $
|
||||
// ========================================================================
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using Csla;
|
||||
using Csla.Data;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
|
||||
namespace Volian.CSLA.Library
|
||||
{
|
||||
/// <summary>
|
||||
/// AssignmentInfoList Generated by MyGeneration using the CSLA Object Mapping template
|
||||
/// </summary>
|
||||
[Serializable()]
|
||||
public partial class AssignmentInfoList : ReadOnlyListBase<AssignmentInfoList, AssignmentInfo>
|
||||
{
|
||||
#region Factory Methods
|
||||
/// <summary>
|
||||
/// Return a list of all projects.
|
||||
/// </summary>
|
||||
public static AssignmentInfoList Get()
|
||||
{
|
||||
return DataPortal.Fetch<AssignmentInfoList>(new Criteria());
|
||||
}
|
||||
// TODO: Add alternative gets -
|
||||
//public static AssignmentInfoList Get(<criteria>)
|
||||
//{
|
||||
// return DataPortal.Fetch<AssignmentInfoList>(new FilteredCriteria(<criteria>));
|
||||
//}
|
||||
public static AssignmentInfoList GetByFolder(int folderID)
|
||||
{
|
||||
return DataPortal.Fetch<AssignmentInfoList>(new FolderCriteria(folderID));
|
||||
}
|
||||
public static AssignmentInfoList GetByGroup(int gid)
|
||||
{
|
||||
return DataPortal.Fetch<AssignmentInfoList>(new GroupCriteria(gid));
|
||||
}
|
||||
public static AssignmentInfoList GetByRole(int rid)
|
||||
{
|
||||
return DataPortal.Fetch<AssignmentInfoList>(new RoleCriteria(rid));
|
||||
}
|
||||
private AssignmentInfoList()
|
||||
{ /* require use of factory methods */ }
|
||||
#endregion
|
||||
#region Data Access Portal
|
||||
[Serializable()]
|
||||
private class Criteria
|
||||
{ /* no criteria - retrieve all rows */ }
|
||||
private void DataPortal_Fetch(Criteria criteria)
|
||||
{
|
||||
this.RaiseListChangedEvents = false;
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "getAssignments";
|
||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||
{
|
||||
IsReadOnly = false;
|
||||
while (dr.Read()) this.Add(new AssignmentInfo(dr));
|
||||
IsReadOnly = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Database.LogException("AssignmentInfoList.DataPortal_Fetch", ex);
|
||||
throw new DbCslaException("AssignmentInfoList.DataPortal_Fetch", ex);
|
||||
}
|
||||
this.RaiseListChangedEvents = true;
|
||||
}
|
||||
[Serializable()]
|
||||
private class FolderCriteria
|
||||
{
|
||||
public FolderCriteria(int folderID)
|
||||
{
|
||||
_FolderID = folderID;
|
||||
}
|
||||
private int _FolderID;
|
||||
public int FolderID
|
||||
{
|
||||
get { return _FolderID; }
|
||||
set { _FolderID = value; }
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(FolderCriteria criteria)
|
||||
{
|
||||
this.RaiseListChangedEvents = false;
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "getAssignmentsByFolder";
|
||||
cm.Parameters.AddWithValue("@FolderID", criteria.FolderID);
|
||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||
{
|
||||
IsReadOnly = false;
|
||||
while (dr.Read()) this.Add(new AssignmentInfo(dr));
|
||||
IsReadOnly = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Database.LogException("AssignmentInfoList.DataPortal_Fetch", ex);
|
||||
throw new DbCslaException("AssignmentInfoList.DataPortal_Fetch", ex);
|
||||
}
|
||||
this.RaiseListChangedEvents = true;
|
||||
}
|
||||
[Serializable()]
|
||||
private class GroupCriteria
|
||||
{
|
||||
public GroupCriteria(int gid)
|
||||
{
|
||||
_GID = gid;
|
||||
}
|
||||
private int _GID;
|
||||
public int GID
|
||||
{
|
||||
get { return _GID; }
|
||||
set { _GID = value; }
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(GroupCriteria criteria)
|
||||
{
|
||||
this.RaiseListChangedEvents = false;
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "getAssignmentsByGroup";
|
||||
cm.Parameters.AddWithValue("@GID", criteria.GID);
|
||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||
{
|
||||
IsReadOnly = false;
|
||||
while (dr.Read()) this.Add(new AssignmentInfo(dr));
|
||||
IsReadOnly = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Database.LogException("AssignmentInfoList.DataPortal_Fetch", ex);
|
||||
throw new DbCslaException("AssignmentInfoList.DataPortal_Fetch", ex);
|
||||
}
|
||||
this.RaiseListChangedEvents = true;
|
||||
}
|
||||
[Serializable()]
|
||||
private class RoleCriteria
|
||||
{
|
||||
public RoleCriteria(int rid)
|
||||
{
|
||||
_RID = rid;
|
||||
}
|
||||
private int _RID;
|
||||
public int RID
|
||||
{
|
||||
get { return _RID; }
|
||||
set { _RID = value; }
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(RoleCriteria criteria)
|
||||
{
|
||||
this.RaiseListChangedEvents = false;
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "getAssignmentsByRole";
|
||||
cm.Parameters.AddWithValue("@RID", criteria.RID);
|
||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||
{
|
||||
IsReadOnly = false;
|
||||
while (dr.Read()) this.Add(new AssignmentInfo(dr));
|
||||
IsReadOnly = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Database.LogException("AssignmentInfoList.DataPortal_Fetch", ex);
|
||||
throw new DbCslaException("AssignmentInfoList.DataPortal_Fetch", ex);
|
||||
}
|
||||
this.RaiseListChangedEvents = true;
|
||||
}
|
||||
#endregion
|
||||
} // Class
|
||||
} // Namespace
|
Reference in New Issue
Block a user