close

在 PowerBuilder 裏,所有控件都有個叫「Tag」的屬性,Tag 可以理解為這控件的標籤,是不是獨有的,就看你的用法了。

我會把它作為 id 去使用,例如在 menu 裏,每個 menu item 都為它定義一個 id ,每個 id 都在數據庫裏面定義它的屬性,比方在 menu 點中這個 id  會打開哪個窗體、這個窗體裏面有哪些新增、刪除等功能,這窗體內的datawindow object 有哪幾個之類,讓一切設定都存在數據庫中,在不需重新部署的情況下都隨時可改。

當然,在打開窗體之前,你也可以以此 id 去檢查對應的用戶權限,確定用戶對這功能有權之後才去打開窗體。

tag.JPG

 

There is a property call 'Tag' and every User Objects, you can use it as an ID for that object.

For example, you can define Tag for each menu items, and then you can define it's properties in database, such as open which window object, what functions can be use in this object, which dataobject should be put in it's datawindow control. Let everything save in database, then you can modify them at any time without deploy new program.

Furthermore, you can use the ID as a access control key to check current user have the particular access right or not.

arrow
arrow
    文章標籤
    PowerBuilder 程式開發
    全站熱搜
    創作者介紹
    創作者 過時程式員 的頭像
    過時程式員

    過時程式員的部落格

    過時程式員 發表在 痞客邦 留言(0) 人氣()