/*
* Namespace Summary
* Copyright (C) 2005+ Bogdan Damian Constantin
* E-Mail: damianbcpetro@gmail.com
* WEB: http://www.sourceforge.net/projects/dataholder
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License 2.1 or later, as
* published by the Free Software Foundation. See the included License.txt
* or http://www.gnu.org/copyleft/lesser.html for details.
*
*/
using System;
using System.Collections;
using System.ComponentModel;
namespace DataHolder.DataPersistence.DBAProvider.Properties{
/// <summary>
/// This provides a simple mapping between the Genric Data property and the Datatable
/// it can be used in cases when the Table Field is not flexible enough
/// </summary>
public class SimplePersistenceField:APersistenceField
{
protected string l_RecordSetName;
protected string l_SelectText;
protected bool l_UseAlias = false;
public SimplePersistenceField(string p_PropertyName, string p_RecordSetName, string p_SelectText):base(p_PropertyName)
{
l_RecordSetName = p_RecordSetName;
l_SelectText = p_SelectText;
}
public SimplePersistenceField(string p_PropertyName, string p_SelectText):this(p_PropertyName, p_PropertyName, p_SelectText)
{
}
public SimplePersistenceField(string p_PropertyName, string p_RecordSetName, string p_SelectText, bool p_UseAlias):this(p_PropertyName, p_RecordSetName, p_SelectText)
{
l_UseAlias = p_UseAlias;
}
public string SelectText
{
get{return l_SelectText;}
}
public override string RecordSetName
{
get{return l_RecordSetName;}
}
public override string Alias
{
get
{
if(l_UseAlias)
return l_RecordSetName;
else
return null;
}
}
}
}
|