Esempio n. 1
0
		public static CrmAddress GetByCrmReplicationUniqueID(
			Guid crmReplicationUniqueID )
		{
			DataRow row = AdoNetSqlHelper.ExecuteRow(
				"GetCrmAddressByCrmReplicationUniqueID",
				new AdoNetSqlParamCollection(
				AdoNetSqlParamCollection.CreateParameter( "@CrmReplicationUniqueID", crmReplicationUniqueID )
				) );

			if ( row == null )
			{
				return null;
			}
			else
			{
				CrmAddress o = new CrmAddress();
				o.Load( row );

				if ( o.IsEmpty )
				{
					return null;
				}
				else
				{
					return o;
				}
			}
		}
Esempio n. 2
0
		/// <summary>
		/// Load an object by a given ID.
		/// </summary>
		public static CrmAddress GetByID(
			int id )
		{
			DataRow row = AdoNetSqlHelper.ExecuteRow(
				"GetCrmAddressByID",
				new AdoNetSqlParamCollection(
				AdoNetSqlParamCollection.CreateParameter( "@ID", id )
				) );

			if ( row == null )
			{
				return null;
			}
			else
			{
				CrmAddress o = new CrmAddress();
				o.Load( row );

				if ( o.IsEmpty )
				{
					return null;
				}
				else
				{
					return o;
				}
			}
		}
Esempio n. 3
0
		/// <summary>
		/// Load all.
		/// </summary>
		public static CrmAddress[] GetAll()
		{
			DataTable table = AdoNetSqlHelper.ExecuteTable(
				"GetAllCrmAddresses",
				new AdoNetSqlParamCollection(
				) );

			if ( table == null )
			{
				return null;
			}
			else
			{
				ArrayList result = new ArrayList();

				foreach ( DataRow row in table.Rows )
				{
					CrmAddress o = new CrmAddress();
					o.Load( row );

					if ( !o.IsEmpty )
					{
						result.Add( o );
					}
				}

				if ( result.Count <= 0 )
				{
					return null;
				}
				else
				{
					return (CrmAddress[])result.ToArray(
						typeof( CrmAddress ) );
				}
			}
		}