Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Three-tier .NET Application Utilizing Three ORM Technologies

, 30 Jan 2010
LINQ to SQL, Entity Framework, and NHibernate used in a parallel fashion in a three-tier WinForms application.
lek.zip
ServiceInterfaceTest
Properties
ServiceLinqToSql
Properties
ServiceNH
Properties
UIInterface
Properties
UIType
Properties
Util
Properties
UtilTest
Properties
Web
001Launch.gif
002Transactions.gif
002TransactionsSHRUNK.gif
003Items.gif
004ERD.gif
005NWAccntDlts.gif
006Transaction.gif
007Arch_Base.gif
008Arch_Util.gif
009Arch_WinApp.gif
010Arch_ClientServer.gif
011Arch_UIInterface.gif
012Arch_GlobalType.gif
013Arch_DTO.gif
014Arch_TierUtils.gif
015Arch_Dal.gif
016Arch_ORM.gif
017ERDSQL.gif
018ERDEF.gif
018ERDEFSHRUNK.gif
019ERDLinqToSQL.gif
019ERDLinqToSQLSHRUNK.gif
AddORMClasses_EF.GIF
AddORMClasses_LtS.GIF
DalEFProject.GIF
DalLinqToSqlProject.GIF
DalNHlProject.GIF
DeltaAllocationAccounts.GIF
DependencyMatrix.GIF
Items.GIF
ItemsForAnAccount.gif
ItemsForAnAccountSHRUNK.gif
ItemsSHRUNK.GIF
Lek.GIF
NetWorthAccountDeltasForAnAccount.GIF
NetWorthAccounts.GIF
Ownerships.GIF
Participants.GIF
SaveTransFunctions.GIF
Summary.GIF
WinApp
Properties
Settings.settings
WinFormClient
Properties
Settings.settings
WinFormServer
Properties
Settings.settings
WinUI
Properties
Settings.settings
Lek1.vsmdi
LocalTestRun.testrunconfig
ProjDep.ppt
Schema.ppt
ClientServer
Properties
ClientUtil
Properties
DalEF
Model.edmx
Properties
DalLinqToSql
DataClasses.dbml
DataClasses.dbml.layout
Properties
Settings.settings
DalNH
Properties
DomainUtil
Properties
DomainUtilTest
Properties
DTO
Properties
GlobalType
Properties
NHibernate
Antlr3.Runtime.dll
Castle.Core.dll
Castle.DynamicProxy2.dll
Iesi.Collections.dll
log4net.dll
NHibernate.ByteCode.Castle.dll
NHibernate.dll
NhLambdaExtensions
bin
NHibernate.LambdaExtensions.dll
doc
Presenter
Properties
ServerUtil
Properties
ServiceEF
Properties
ServiceFactory
Properties
ServiceInterface
Properties
using System;
using System.Collections.Generic;
using System.Text;
using s = System;
using System.Linq;
using gt=GlobalType;

namespace DomainUtil
{
	public class Participants
	{
		gt.IParticipant[] _arrParticipants;
		s.Collections.Generic.Dictionary<int, int> _dictOfIndexesByID;
		public Participants(IList<gt.IParticipant> lstParticipants)
		{
			IEnumerable<gt.IParticipant> sorted = lstParticipants.OrderBy(o=>o.ID);
			_arrParticipants = sorted.ToArray();
			_dictOfIndexesByID = new Dictionary<int,int>();
			int i = -1;
			foreach(gt.IParticipant aParticipant in sorted)
			{
				i++;
				_dictOfIndexesByID.Add(aParticipant.ID, i);
			}
		}
		public int IndexFromID(int iID)
		{
			return _dictOfIndexesByID[iID];
		}
		public string NameFromIndex(int iIndex)
		{
			return _arrParticipants[iIndex].Name;
		}
		public string NameFromID(int iID)
		{
			return NameFromIndex(IndexFromID(iID));
		}
		public int IDFromIndex(int iIndex)
		{
			return _arrParticipants[iIndex].ID;
		}

		public int Count
		{
			get
			{
				return _arrParticipants.Length;
			}
		}
		public int[] GetArrayOfIDs()
		{
			int[] arr = new int[_arrParticipants.Length];
			for (int i = 0; i < _arrParticipants.Length; i++)
			{
				arr[i] = _arrParticipants[i].ID;
			}
			return arr;
		}
		public gt.IParticipant[] GetArryOfObjects()
		{
			gt.IParticipant[] arr = new gt.IParticipant[_arrParticipants.Length];
			for (int i = 0; i < _arrParticipants.Length; i++)
			{
				arr[i] = _arrParticipants[i];
			}
			return arr;
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Bryan Thomas Weikel
Software Developer (Senior) Austin Regional Clinic
United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 30 Jan 2010
Article Copyright 2009 by Bryan Thomas Weikel
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid