The interface is used to manage the 'Employee' tables in the database. It includes the following methods:
Name |
COM Type |
DB Type |
Description |
|
BSTR |
A15 |
Uniquely identifies an employee |
|
BSTR |
A30 |
Employee's first name |
|
BSTR |
A30 |
Employee's last name |
|
SHORT |
Smallint |
Number of current store |
|
BSTR |
A50 |
Street, street number and suite/ apartment number |
|
BSTR |
A20 |
City name |
|
BSTR |
A2 |
State or province code |
|
BSTR |
A10 |
Phone number without mask |
|
Int |
Integer |
Social Insurance Number |
|
BSTR |
A10 |
Zip or postal code |
|
Int |
Integer |
Discount rate |
|
Int |
Integer |
Identify each salesperson |
|
VARIANT |
Numeric (4,2) |
Commission rate |
|
SHORT |
Smallint |
Identify price level for discount |
|
SHORT |
Smallint |
Employee type |
|
SHORT |
Smallint |
Further classify employee |
|
Int |
Integer |
Identify cashier |
|
BSTR |
A20 |
Password for the employee |
|
SHORT |
Smallint |
Authority level for security |
|
BOOL |
A1 |
Indicate whether or not a preset price can be modified at POS at the time of sale |
|
SHORT |
Smallint |
Sales region ID |
|
BOOL |
A1 |
Whether an employee is clocked in or clocked out |
|
Int |
Int |
Define the reason given for the last clock in/ out |
|
DT |
TimeStamp |
Actual time employee last clocked in/ out |
|
BOOL |
A1 |
Define whether the employee is logged on as a cashier |
|
BOOL |
A1 |
Define whether or not the employee must change their password |
|
SHORT |
Smallint |
Indicate the POS terminal the cashier is logged onto. |
|
SHORT |
Smallint |
Indicate the drawer number to use for the employee at the POS terminal the cashier is logged onto. |
|
DT |
Timestamp |
Date and time the row last modified. |
|
BSTR |
A12 |
Employee short name |
|
SHORT |
Smallint |
|
|
VARIANT |
Numeric (20,6) |
Employee salary |
|
VARIANT |
Numeric (20,6) |
Hourly paid rate |
|
SHORT |
Smallint |
Identify profile ID |
HRESULT Inquiry (BSTR bstrXmlEmpInq, BSTR *bstrXmlEmpInqResult)
This method is used to retrieve records from 'Employee' table. In order to perform proper operations, these mandatory parameters have to be defined. The record found can be none, one or more than one based on the searching criteria. These mandatory parameters have to be defined when calling
the function, others can be empty string. If the user prefers to find employee whose last name starting with letter D, the LastName
is defined as D*
so the search is based on the query like rather than equal to operator. EmployeeNumber
is
defined in the same way. This provides flexibility to the user to perform database operations that are required.
Since not all employees have the authority to perform inquiry, so 'cashier number', 'password' and 'store number' are required in order to check employee security ID. Certain employees may be allowed to perform an inquiry while others are allowed to perform full operations such as inquiry and update.
After the method is called, the return value has to be checked. If it is S_OK
, the return string contains the data for the found record. If more than one record is found in the query, all of them can be parsed into the response string and it is up to the client
how to use these data properly.
If there is no record found in the database, the result is defined as S_FALSE
and the return string includes a message such as TmxEmployee Error: No Record Found in the Database!
. If the cashier does not have the authority to perform
Inquiry, E_INVALIDAUTHORITY
is returned and the error message is defined as TmxEmployee Error: Invalid Security for Inquiry!
.
If there is a communication error, E_COMMUNICATIONERROR
is returned and the error message is defined as TmxEmployee Error: Communication Error!
.
|
String containing XML document, including |
|
In contains the detail data for the found records or a particular error if the inquiry failed. |
|
If the record is successfully returned from the database. |
|
If no record is found during inquiry. |
|
If there is a communication error. |
|
If the employee does not have authority to inquiry 'Employee' table. |
|
If other error occurs during Inquiry. |
HRESULT Update(BSTR bstrXmlEmpUpdate, BSTR *bstrXmlEmpUpdateResult)
|
String containing all columns defined in 'Employee' table plus one more element to indicate the operation to Update. It includes:
|
|
It contains two optional elements. If the result is |
|
If the record is successfully returned from the database. |
|
If employee is not found in the database. |
|
If there is a communication error. |
|
If the employee does not have authority to inquiry 'Employee' table. |
|
If other error occurs during Update. |
This method is used to update an 'Employee' record based on the UpdateType
element. Use the Inquiry
method to retrieve the record first and change certain fields. Then call this method. The fields passed to the stored procedure have
to be checked to make sure that the value passed to the stored procedure is in the right data type format. If an error happens, the record is not updated. This can be done by both XML schema validation.
If the employee who performs the update operation does not have the authority to update 'Employee' table, E_INVALIDAUTHORITY
is returned.
EmployeeAdd
and EmployeeModify
require that the following elements are defined:
1 |
|
Mandatory (M) |
2 |
|
M |
3 |
|
M |
4 |
|
M |
5 |
|
M |
6 |
|
M |
7 |
|
NULL if not setup |
8 |
|
NULL if not setup |
9 |
|
NULL if not setup |
10 |
|
NULL if not setup |
11 |
|
NULL if not setup |
12 |
|
M |
13 |
|
0 if not set |
14 |
|
1 if not set |
15 |
|
M |
16 |
|
M |
17 |
|
NULL if not set |
18 |
|
1 if not set |
19 |
|
NULL if not set |
20 |
|
NULL if not set |
21 |
|
NULL if not set |
22 |
|
NULL if not set |
23 |
|
NULL if not set |
24 |
|
NULL if not set |
25 |
|
NULL if not set |
EmployeeDelete
requires that the following elements be defined:
1 |
|
Mandatory (M) |
2 |
|
(M) |
3 |
|
(M) |
4 |
|
(M) |
Note
EmployeeDeleteAll
deletes all employee records in the 'Employee' table.
HRESULT InquirySecurity (BSTR bstrXmlEmpInqSecurity, BSTR *)
This method is used to retrieve the security level for the entered employee . After the method is called, the AuthorizationLevel
is included in the output string if the result is S_OK
. The authorization level controls what functions
the employee can perform and what functions they cannot.
If no record is found, S_FALSE
is returned.
|
String containing XML document, including |
|
It contains two optional elements. If the result is |
|
If the record is successfully returned from the database. |
|
If there is no record found. |
|
If there is a communication error. |
|
If other error occurs during inquiry. |
Currently several schema have been defined for each of these methods. They are:
schema_Triversity_employee_inquiry_request_1
schema_Triversity_employee_inquiry_response_1
schema_Triversity_employee_update_request_1
schema_Triversity_employee_inquiry_response_1
schema_Triversity_employee_security_inquiry_request_1
schema_Triversity_employee_security_inquiry_response_1
One schema example for Employee Inquiry can be defined as:
<?xml version= "1.0" ?>
<Schema name = "schema_Triversity_employee_inquiry_request_1" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schema-microsoft-com:datatypes" xmlns:trvdic="urn:trv_dictionary_0.xml">
<!-- list of elements for employee inquiry request -->
<ElementType name="EMPLOYEE_INQUIRY_REQUEST" order="seq" content="eltOnly">
<!-- mandatory elements -->
<element type="trvdic:storeNumber" minOccurs="1" maxOccurs="1" />
<element type="trvdic:cashierNumber" minOccurs="1" maxOccurs="1" />
<element type="trvdic:password" minOccurs="1" maxOccurs="1" />
<element type="trvdic:cashierStoreNumber" minOccurs="1" maxOccurs="1" />
<!-- optional elements -->
<element type="trvdic:employeeNumber" minOccurs="0" maxOccurs="1" />
<element type="trvdic:firstName" minOccurs="0" maxOccurs="1" />
<element type="trvdic:lastName" minOccurs="0" maxOccurs="1" />
</ElementType>
</Schema>