OpenPetra
Free Administration Software for Non-Profits
Ict.Petra.Server.MPartner.Common.TNewPartnerKey Class Reference

Create a new partner key, depending on the selected field; make sure, there are no duplicate partner keys More...

Static Public Member Functions

static System.Int64 GetNewPartnerKey (System.Int64 AFieldPartnerKey, TDataBase ADataBase=null)
 this returns the default next available (highest) partner key of the given field More...
 
static bool SubmitNewPartnerKey (System.Int64 AFieldPartnerKey, System.Int64 AOriginalDefaultKey, ref System.Int64 ANewPartnerKey, TDataBase ADataBase=null)
 this checks if the new key is still available, and makes sure it will not be used as a default key anymore More...
 
static System.Int64 ReservePartnerKeys (System.Int64 AFieldPartnerKey, ref Int32 ANumberOfKeys, TDataBase ADataBase=null)
 reserve a number of partner keys, to be used by the calling function. useful to create many partner at once, eg. for the demodata More...
 

Detailed Description

Create a new partner key, depending on the selected field; make sure, there are no duplicate partner keys

Behaviour (same as in Petra 2.1, ma1001.w): A screen allows the user to either use the "default next partner key", or enter a custom partnerkey. If this is cancelled, nothing happens to the database. If it is confirmed, then the "default next partner key" is increased in the database. 2 users on the "partnerkey selection screen" at the same time, get the same partnerkey: When the second user hits ok, his partner key will be increased, to the next currently free key If a key is manually entered and it is already being used for a partner, then the screen should not allow to proceed to the partner edit screen. Problem (same as in Petra 2.1): If entering a partner key that already exists, then the ok button on the "partnerkey selection screen" cannot really check. saving the second one will fail, so you lose the data entered because you need to cancel the edit screen.

How to use: First call GetNewPartnerKey to get the "default next partner key" When the user has made his choice about the partnerkey, call SubmitNewPartnerKey; if it returns true, use the returned partnerkey (in the var parameter); otherwise if it returns false and -1 for the partnerkey, the user has to enter a different key

Member Function Documentation

◆ GetNewPartnerKey()

static System.Int64 Ict.Petra.Server.MPartner.Common.TNewPartnerKey.GetNewPartnerKey ( System.Int64  AFieldPartnerKey,
TDataBase  ADataBase = null 
)
inlinestatic

this returns the default next available (highest) partner key of the given field

Parameters
AFieldPartnerKeyif this is -1, then the sitekey defined in System Parameters is used
ADataBase
Returns
void

◆ ReservePartnerKeys()

static System.Int64 Ict.Petra.Server.MPartner.Common.TNewPartnerKey.ReservePartnerKeys ( System.Int64  AFieldPartnerKey,
ref Int32  ANumberOfKeys,
TDataBase  ADataBase = null 
)
inlinestatic

reserve a number of partner keys, to be used by the calling function. useful to create many partner at once, eg. for the demodata

Parameters
AFieldPartnerKey
ANumberOfKeys
ADataBase
Returns
the first valid partner key to use

◆ SubmitNewPartnerKey()

static bool Ict.Petra.Server.MPartner.Common.TNewPartnerKey.SubmitNewPartnerKey ( System.Int64  AFieldPartnerKey,
System.Int64  AOriginalDefaultKey,
ref System.Int64  ANewPartnerKey,
TDataBase  ADataBase = null 
)
inlinestatic

this checks if the new key is still available, and makes sure it will not be used as a default key anymore

Parameters
AFieldPartnerKey
AOriginalDefaultKeythis has been previously retrieved from GetNewPartnerKey
ANewPartnerKeythe user proposes this key for a new partner; the function can change it and return a valid value, or -1
ADataBase
Returns
whether or not ANewPartnerKey has a valid new partner key; if it cannot be assigned, the function returns false, and ANewPartnerKey is -1

The documentation for this class was generated from the following file: