Net2 Configuration with Controller DB

In order to use the Controller database and send the records after printing to Net2, some configurations will be needed.
Starting from the beginning, create a new card. (Skip the Create-a-Card Wizard go directly to Card Designer)
On the Card Designer we will establish the database connections, as it follows:

Database Setup

Controller
Type – CMS v2
Database - https://api.cardexchangecloud.com

Paxton
Type – Data-source plug-in
Server – localhost
Port – 8025
Database – Select the Net2Exchange.dll in the Cardexchange installation folder (C:\Program Files (x86)\CardExchange Solutions\CardExchange Gateway\Net2Exchange.dll)

Enable Login with user name and password and insert your credentials to login.
On the next window select the Controller database and check the option “Read data-items from this database” with the values:

View name: Production
Primary key: Id

Leave the Paxton database unchecked and click on next to jump on the next window.
In the Record Look-Up database, the one that should be selected is the Controller database.
This way Producer displays the data from there, as it is the data in use.
Select the records that you want to be shown in the card and move to the last window in the database connection wizard.
Here is were you will create the storage items for the Controller and Paxton databases.

CONTROLLER

ChipSerialNumber
Table name: Production
Primary key: Id
Column name: ChipSerialNumber
Storage-item usage: Store data after printing a card

IssueNumber
Table name: Production
Primary key: Id
Column name: Freefield 15
Storage-item usage: Store data after printing a card

NumberOfTries
Table name: Production
Primary key: Id
Column name: NumberOfTries
Storage-item usage: Use as print counter

UserId
Table name: Production
Primary key: Id
Column name: Freefield1
Storage-item usage: Store data after printing a card

PAXTON

CardTypeId
Table name: Cards
Primary key: UserId
Column name: Cardtyppe
Storage-item usage: Store data after printing a card
Advanced Options: Supply value for primary key & Always insert(uniqueness primary key not guaranteed)

UserId
Table name: Cards
Primary key: UserId
Column name: UserId
Storage-item usage: Store data after printing a card

After this configuration, click on finish and go to MIFARE tab to create a definition for your card.
When the definition is created, go to Home tab and then Properties, this is were we will create 2 new variables.
Select the variables tab, create the variables UID and IssueNo.


Next go to functions tab and insert the following function:

def issueno (IssueNo):

  if IssueNo == '':

    return 1

  else:

    currentissueno = int(IssueNo)

    return str(currentissueno + 1)


This will allow us to give the value of Script to the IssueNo variable and use it as a counter.

Close the Properties window and the Designer saving all the changes.
The next step is going to Configuration tab < Card Definition Wizard , here we will add the Plug Ins needed to connect Producer to Net2.
To do so in the bottom of the Card Definition Wizard window, theres an option saying “Do you want to use external functions or plug-ins?” click on the check box of the option and go to Edit.


Add 2 External Functions:


Cards
DLL File - Net2Exchange.dll
(General Properties – Call using a button)


Net2

DLL File – Net2ExchangeX.dll
(General Properties – Call when Printing)
(Evaluation moment – Before moving the card into the printer)

Click on finish and both plug-ins will be added, then finish again.

With this part of the configuration done, go to Card Designer in the Configuration tab.
Go to the Data tab on the left side of the designer window, to give values to the variables and storage items we’ve created in the steps before.
On the Variables tab, click on UssueNo and assign it to Freefield4, select the UID give it the value of the Mifare/DESFire definition and change the format to Integer – d10.

Next click on Storage Items and give them the following values:


CONTROLLER
ChipSerialNumber – Script < UID[2:10]
IssueNo – Script < issueno(IssueNo)


PAXTON
CardTypeId – Fixed Value < 1

The UserId Storage items will stay unmapped as we will address them in the next steps.
Last but not least, go to Storage-item Keys.


Cards – Script < UID[2:10] < Format Decimal

This will provide us a UID with the max of 8 digits, as this will be mapped to create the token on Net2 and the maximum of digits that’s allowed on the Net2 token is 8. We use this method in order to use the UID from the card as a token in Net2.

 

Mappings

 

Storage Items

Secondry.CardTypeId(no mapping)

Primary.UserId(Net2.UserId)

Secondry.UserId(Net2.UserId)

 

External-Storage Items

Cards.UserId - Freefield2(Primary)

Net2.UserId - Freefield2(Primary)

Net2.AccessLevelId - .NET Function < Freefield13(Primary)

Net2.DepartmentId - .NET Function < Freefield3(Primary)

Net2.FirstName - DB Column < FirstName(Primary)

Net2.Surname - DB Column < LastName(Primary)

Net2.Fax - PersonNumber(Primary)

Net2.Active - Enter Manually(TRUE)