Get the App
SLTechnology News&Howtos  ›  Database  › 

Description of organizational structure construction

Shulou Source: shulou.com Published: 2022-06-01 10:34:56 09月17日 Update

In the metrics rapid development platform, in the organization maintenance, there are several organization-related functions such as department post setting, personnel registration and personnel placement. The table of these function operation should have the sa_dept_dict,sa_staff_info,sa_staff_ table. After the system uses the functions provided by the platform to maintain the departmental posts, personnel and posts, the personnel will be able to see the effect of the new settings when they log in again.

If the secondary developer wants to rebuild the functions of department post setting, personnel registration and personnel post setting, when inserting data into these tables, if the data is directly executed by the insert into table, then after the personnel log in again, they will not see the effect of the setting, this is because the system performance is taken into account in the platform, and the organizational data is cached.

So when users build the organization for the second time, how to refresh the organization cache?

When we insert data into these tables, we cannot use executeNonquery (insert into). Instead, we need to use the SaveDataTable method provided by the platform, which automatically refreshes when the table data of the organization is detected.

Example of how to use it (build a staff post)

Dim dt = executeSelect ("select ID,USER_ID,DEPT_ID,SORT_ORDER,IS_DEFAULT from SA_STAFF_ROLE where 1: 0")

Dim dr

Dr = dt.NewRow ()

Dr ["ID"] = Guid ()

Dr ["USER_ID"] = manager information. GetFocusedRowValue ("ID")

Dr ["DEPT_ID"] = return_RoleID

Dr ["SORT_ORDER"] = 1

Dr ["IS_DEFAULT"] = 0

Dt.Rows.Add (dr)

SaveDataTable ("default", "SA_STAFF_ROLE", dt)

'Save DataTable. The first parameter is the database name, string; the second parameter is the table name, string

'The third parameter is the DataTable corresponding to the table, and only the fields in the database can be saved.

SaveDataTable ("default", "table_name", datatable)

Original address: http://bbs.delit.cn/thread-1067-1-1.html

Please indicate the source of the reprint:

Written by: measurement Technology http://www.delit.cn

Tags: People data institutions organizations functions platforms parameters posts methods time departments characters strings position settings effects databases systems caching development login Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Docker Microsoft MySQL Apple