C# Class Rock.Model.AttendanceCodeService

Data Access/Service class for Rock.Model.AttendanceCode entity types
Mostrar archivo Open project: NewSpring/Rock Class Usage Examples

Public Methods

Method Description
GetNew ( int codeLength = 3 ) : AttendanceCode

Returns a new Rock.Model.AttendanceCode comprised of random alpha numeric characters.

GetNew ( int alphaLength = 2, int numericLength = 4, bool isRandomized = true ) : AttendanceCode

Returns a new Rock.Model.AttendanceCode with a specified number of alpha characters followed by another specified number of numeric characters. The numeric character sequence will not repeat for "today" so ensure that you're using a sufficient numericLength otherwise it will be unable to find a unique number. Also note as the issued numeric codes reaches the maximum (from the set of possible), it will take longer and longer to find an unused number.

Private Methods

Method Description
GenerateRandomAlphaCode ( int length ) : string

Generates a random (security) code containing only alpha characters.

GenerateRandomCode ( int length ) : string

Generates a random (security) code.

GenerateRandomNumericCode ( int length ) : string

Generates a random (security) code containing only numeric characters.

Method Details

GetNew() public static method

Returns a new Rock.Model.AttendanceCode comprised of random alpha numeric characters.
public static GetNew ( int codeLength = 3 ) : AttendanceCode
codeLength int A representing the length of the (security) code.
return AttendanceCode

GetNew() public static method

Returns a new Rock.Model.AttendanceCode with a specified number of alpha characters followed by another specified number of numeric characters. The numeric character sequence will not repeat for "today" so ensure that you're using a sufficient numericLength otherwise it will be unable to find a unique number. Also note as the issued numeric codes reaches the maximum (from the set of possible), it will take longer and longer to find an unused number.
public static GetNew ( int alphaLength = 2, int numericLength = 4, bool isRandomized = true ) : AttendanceCode
alphaLength int A representing the length of the (alpha) portion of the code.
numericLength int A representing the length of the (digit) portion of the code.
isRandomized bool A that controls whether or not the AttendanceCodes should be generated randomly or in order (starting from the smallest).
return AttendanceCode