/// <summary>
		/// Selects CRD_ProfileProfile values from Database and assigns them to the appropriate DO_CRD_ProfileProfile property.
		/// </summary>
		/// <param name="IFProfile_in">IFProfile</param>
		/// <param name="IFProfile_parent_in">IFProfile_parent</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>null if CRD_ProfileProfile doesn't exists at Database</returns>
		public static SO_CRD_ProfileProfile getObject(
			long IFProfile_in, 
			long IFProfile_parent_in, 
			DBConnection dbConnection_in
		) {
			SO_CRD_ProfileProfile _output = null;

			DBConnection _connection = (dbConnection_in == null)
				? DO__utils.DBConnection_createInstance(
					DO__utils.DBServerType,
					DO__utils.DBConnectionstring,
					DO__utils.DBLogfile
				) 
				: dbConnection_in;
			IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
				_connection.newDBDataParameter("IFProfile_", DbType.Int64, ParameterDirection.InputOutput, IFProfile_in, 0), 
				_connection.newDBDataParameter("IFProfile_parent_", DbType.Int64, ParameterDirection.InputOutput, IFProfile_parent_in, 0)
			};
			_connection.Execute_SQLFunction("sp0_CRD_ProfileProfile_getObject", _dataparameters);
			if (dbConnection_in == null) { _connection.Dispose(); }

			if (_dataparameters[0].Value != DBNull.Value) {
				_output = new SO_CRD_ProfileProfile();

				if (_dataparameters[0].Value == System.DBNull.Value) {
					_output.IFProfile = 0L;
				} else {
					_output.IFProfile = (long)_dataparameters[0].Value;
				}
				if (_dataparameters[1].Value == System.DBNull.Value) {
					_output.IFProfile_parent = 0L;
				} else {
					_output.IFProfile_parent = (long)_dataparameters[1].Value;
				}

				_output.haschanges_ = false;
				return _output;
			}

			return null;
		}
		private static SO_CRD_ProfileProfile[] getRecord(
			DataTable dataTable_in
		) {
			DataColumn _dc_ifprofile = null;
			DataColumn _dc_ifprofile_parent = null;

			SO_CRD_ProfileProfile[] _output 
				= new SO_CRD_ProfileProfile[dataTable_in.Rows.Count];
			for (int r = 0; r < dataTable_in.Rows.Count; r++) {
				if (r == 0) {
					_dc_ifprofile = dataTable_in.Columns["IFProfile"];
					_dc_ifprofile_parent = dataTable_in.Columns["IFProfile_parent"];
				}

				_output[r] = new SO_CRD_ProfileProfile();
				if (dataTable_in.Rows[r][_dc_ifprofile] == System.DBNull.Value) {
					_output[r].ifprofile_ = 0L;
				} else {
					_output[r].ifprofile_ = (long)dataTable_in.Rows[r][_dc_ifprofile];
				}
				if (dataTable_in.Rows[r][_dc_ifprofile_parent] == System.DBNull.Value) {
					_output[r].ifprofile_parent_ = 0L;
				} else {
					_output[r].ifprofile_parent_ = (long)dataTable_in.Rows[r][_dc_ifprofile_parent];
				}

				_output[r].haschanges_ = false;
			}

			return _output;
		}
		/// <summary>
		/// Inserts/Updates CRD_ProfileProfile values into/on Database. Inserts if CRD_ProfileProfile doesn't exist or Updates if CRD_ProfileProfile already exists.
		/// </summary>
		/// <param name="forceUpdate_in">assign with True if you wish to force an Update (even if no changes have been made since last time getObject method was run) and False if not</param>
		/// <returns>True if it didn't exist (INSERT), and False if it did exist (UPDATE)</returns>
		public static bool setObject(
			SO_CRD_ProfileProfile CRD_ProfileProfile_in, 
			bool forceUpdate_in
		) {
			return setObject(
				CRD_ProfileProfile_in, 
				forceUpdate_in, 
				null
			);
		}
		/// <summary>
		/// Inserts/Updates CRD_ProfileProfile values into/on Database. Inserts if CRD_ProfileProfile doesn't exist or Updates if CRD_ProfileProfile already exists.
		/// </summary>
		/// <param name="forceUpdate_in">assign with True if you wish to force an Update (even if no changes have been made since last time getObject method was run) and False if not</param>
		/// <param name="dbConnection_in">Database connection, making the use of Database Transactions possible on a sequence of operations across the same or multiple DataObjects</param>
		/// <returns>True if it didn't exist (INSERT), and False if it did exist (UPDATE)</returns>
		public static bool setObject(
			SO_CRD_ProfileProfile CRD_ProfileProfile_in, 
			bool forceUpdate_in, 
			DBConnection dbConnection_in
		) {
			bool ConstraintExist_out;
			if (forceUpdate_in || CRD_ProfileProfile_in.haschanges_) {
				DBConnection _connection = (dbConnection_in == null)
					? DO__utils.DBConnection_createInstance(
						DO__utils.DBServerType,
						DO__utils.DBConnectionstring,
						DO__utils.DBLogfile
					) 
					: dbConnection_in;
				IDbDataParameter[] _dataparameters = new IDbDataParameter[] {
					_connection.newDBDataParameter("IFProfile_", DbType.Int64, ParameterDirection.Input, CRD_ProfileProfile_in.IFProfile, 0), 
					_connection.newDBDataParameter("IFProfile_parent_", DbType.Int64, ParameterDirection.Input, CRD_ProfileProfile_in.IFProfile_parent, 0), 

					//_connection.newDBDataParameter("Exists", DbType.Boolean, ParameterDirection.Output, 0, 1)
					_connection.newDBDataParameter("Output_", DbType.Int32, ParameterDirection.Output, null, 0)
				};
				_connection.Execute_SQLFunction(
					"sp0_CRD_ProfileProfile_setObject", 
					_dataparameters
				);
				if (dbConnection_in == null) { _connection.Dispose(); }

				ConstraintExist_out = (((int)_dataparameters[2].Value & 2) == 1);
				if (!ConstraintExist_out) {
					CRD_ProfileProfile_in.haschanges_ = false;
				}

				return (((int)_dataparameters[2].Value & 1) != 1);
			} else {
				ConstraintExist_out = false;

				return  false;
			}
		}
		public static DataTable getDataTable(
			SO_CRD_ProfileProfile[] serializableobjects_in
		) {
			DataTable _output = new DataTable();
			DataRow _dr;

			DataColumn _dc_ifprofile = new DataColumn("IFProfile", typeof(long));
			_output.Columns.Add(_dc_ifprofile);
			DataColumn _dc_ifprofile_parent = new DataColumn("IFProfile_parent", typeof(long));
			_output.Columns.Add(_dc_ifprofile_parent);

			foreach (SO_CRD_ProfileProfile _serializableobject in serializableobjects_in) {
				_dr = _output.NewRow();

				_dr[_dc_ifprofile] = _serializableobject.IFProfile;
				_dr[_dc_ifprofile_parent] = _serializableobject.IFProfile_parent;

				_output.Rows.Add(_dr);
			}

			return _output;
		}