Class DBModif
Abstraction of a DB Modification Object (concrete classes DBMapper, DBAction or DBSeqnce)
Namespace: DBaddin
Assembly: DBaddin.dll
Syntax
public abstract class DBModif
Constructors
| Improve this Doc View SourceDBModif()
needed for legacy DBmapper constructor
Declaration
public DBModif()
DBModif(CustomXMLNode)
Declaration
public DBModif(CustomXMLNode definitionXML)
Parameters
Name | Description |
---|---|
definitionXML |
Fields
| Improve this Doc View SourceaskBeforeExecute
ask for confirmation before execution of DBModif
Declaration
protected bool askBeforeExecute
Field Value
Description |
---|
confirmText
Text displayed for confirmation before doing dbModif instead of standard text
Declaration
protected string confirmText
Field Value
Description |
---|
database
Database to store to, not available to DB Sequences
Declaration
protected string database
Field Value
Description |
---|
dbmodifName
unique key of DBModif
Declaration
protected string dbmodifName
Field Value
Description |
---|
env
environment specific for the DBModif object, if left empty then set to default environment (either 0 or currently selected environment)
Declaration
protected string env
Field Value
Description |
---|
execOnSave
should DBMap be saved / DBAction be done on Excel Saving? (default no)
Declaration
public bool execOnSave
Field Value
Description |
---|
paramTargetName
DBModif name of target range
Declaration
protected string paramTargetName
Field Value
Description |
---|
TargetRange
Range where DBMapper data is located (only DBMapper and DBAction; paramText is stored in custom doc properties having the same Name)
Declaration
protected Range TargetRange
Field Value
Description |
---|
Methods
| Improve this Doc View SourceaddHiddenFeatureDefs(CustomXMLNode)
to re-add hidden features only available in XML
Declaration
public virtual void addHiddenFeatureDefs(CustomXMLNode definitionXML)
Parameters
Name | Description |
---|---|
definitionXML | the definition node of the DB Modifier where the hidden features should be added |
confirmExecution(Boolean)
asks user the confirmation question, in case it is required by the DB Modifier
Declaration
public MsgBoxResult confirmExecution(bool WbIsSaving = false)
Parameters
Name | Description |
---|---|
WbIsSaving |
Returns
Description |
---|
Yes, No or Cancel (only possible when saving to finish questions) |
DBModifSaveNeeded()
checks whether DBModifier needs saving, usually because execOnSave is set (in case of CUD DBMappers if any i/u/d flags are present)
Declaration
public virtual bool DBModifSaveNeeded()
Returns
Description |
---|
true if save needed |
doDBModif(Boolean, String, Boolean)
does the actual DB Modification
Declaration
public virtual void doDBModif(bool WbIsSaving = false, string calledByDBSeq = "", bool TransactionOpen = false)
Parameters
Name | Description |
---|---|
WbIsSaving | |
calledByDBSeq | |
TransactionOpen |
doDBRefresh(String, Dictionary<String, Boolean>, Dictionary<String, Boolean>, Boolean)
refresh a DB Function (currently only DBListFetch and DBSetQuery) by invoking its respective DBAction procedure additionally prepare the inputs to the DBAction procedure as a UDF cannot be invoked from VB code
Declaration
protected bool doDBRefresh(string srcExtent, Dictionary<string, bool> executedDBMappers = null, Dictionary<string, bool> modifiedDBMappers = null, bool TransactionIsOpen = false)
Parameters
Name | Description |
---|---|
srcExtent | the unique hidden name of the DB Function cell (DBFsource(GUID)) |
executedDBMappers | in a DB Sequence, this parameter notifies of DBMappers that were executed before to allow avoidance of refreshing changes |
modifiedDBMappers | in a DB Sequence, this parameter notifies of a DBMapper that had changes, necessary to avoid deadlocks |
TransactionIsOpen | in a DB Sequence, this parameter notifies of an open transaction, necessary to avoid deadlocks |
Returns
Description |
---|
getEnv()
public accessor function: get Environment (integer) where connection id should be taken from
Declaration
protected int getEnv()
Returns
Description |
---|
the Environment of the DBModif, 0 to indicate a not set environment |
getName()
gets the name for this DBModifier
Declaration
public string getName()
Returns
Description |
---|
getParamFromXML(CustomXMLNode, String, String)
wrapper to get the single definition element values from the DBModifier CustomXML node, also checks for multiple definition elements
Declaration
protected string getParamFromXML(CustomXMLNode definitionXML, string nodeName, string ReturnType = "")
Parameters
Name | Description |
---|---|
definitionXML | the CustomXML node for the DBModifier |
nodeName | the definition element's name (e.g "env") |
ReturnType |
Returns
Description |
---|
the definition element's value |
Exceptions
Condition |
---|
if multiple elements exist for the definition element's name throw warning ! |
getTargetRange()
public accessor function
Declaration
public Range getTargetRange()
Returns
Description |
---|
the targetRange itself |
getTargetRangeAddress()
public accessor function
Declaration
public string getTargetRangeAddress()
Returns
Description |
---|
the targetRangeAddress nicely formatted |
openDatabase(String)
open a database specific connection, not available to DB Sequences
Declaration
public bool openDatabase(string DBSequenceEnv = "")
Parameters
Name | Description |
---|---|
DBSequenceEnv |
Returns
Description |
---|
setDBModifCreateFields(ref DBModifCreate)
sets the content of the DBModif Create/Edit Dialog
Declaration
public virtual void setDBModifCreateFields(ref DBModifCreate theDBModifCreateDlg)
Parameters
Name | Description |
---|---|
theDBModifCreateDlg |
setTargetRange(Range)
when resizing target ranges from functions as DBListFetch and DBSetQuery, need to notify also DBModif objects (DBMapper)
Declaration
public void setTargetRange(Range newTargetRange)
Parameters
Name | Description |
---|---|
newTargetRange |