declare
xx number(1) := 0;
begin
if USER IN ('PMS','SUPER') THEN
xx :=1;
elsif PMS.IS_PERMITTED_TO_FORM(USER,'BILL','ACNO_REB') = 1 THEN
xx :=1;
ELSIF PMS.IS_PERMITTED_TO_FORM(USER,'BILL','ACNO_REB') = 0 THEN
xx :=0;
ELSE
xx :=0;
end if;
-- ===============
if xx = 1 then
CALL_FORM('BILL\FORMS\ACNO_REB.fmx',NO_HIDE,NO_REPLACE);
else
message('You have no permission to run this form ');
message('Ok');
end if;
end;
-------------------
declare
xx number(1) := 0;
begin
if USER IN ('PMS','SUPER') THEN
xx :=1;
elsif PMS.IS_PERMITTED_TO_FORM(USER,'BILL','DISCONNECT') = 1 THEN
xx :=1;
ELSIF PMS.IS_PERMITTED_TO_FORM(USER,'BILL','DISCONNECT') = 0 THEN
xx :=0;
ELSE
xx :=0;
end if;
-- ===============
if xx = 1 then
CALL_FORM('BILL\FORMS\DISCONNECT.fmx',NO_HIDE,NO_REPLACE);
else
message('You have no permission to run this form ');
message('Ok');
end if;
end;
-----------------------------
PACKAGE EnableDisableItem IS
Procedure ReplaceDisableMenu( menuName VARCHAR2, menuItemName VARCHAR2);
Procedure ReplaceEnableMenu( menuName VARCHAR2, menuItemName VARCHAR2);
END;
MENU ENABLE DISABLE
PACKAGE BODY EnableDisableItem IS
PROCEDURE ReplaceDisableMenu( menuName in VARCHAR2, menuItemName in VARCHAR2) is
hMenuItem MENUITEM;
begin
hMenuItem := FIND_MENU_ITEM(menuName||'.'||menuItemName);
if not ID_NULL(hMenuItem) and GET_MENU_ITEM_PROPERTY(hMenuItem,VISIBLE) = 'TRUE' then
SET_MENU_ITEM_PROPERTY(hMenuItem, ENABLED, PROPERTY_FALSE);
end if;
end;
PROCEDURE ReplaceEnableMenu( menuName in VARCHAR2, menuItemName in VARCHAR2) is
hMenuItem MENUITEM;
begin
hMenuItem := FIND_MENU_ITEM(menuName||'.'||menuItemName);
if not ID_NULL(hMenuItem) and GET_MENU_ITEM_PROPERTY(hMenuItem,VISIBLE) = 'TRUE' then
SET_MENU_ITEM_PROPERTY(hMenuItem, ENABLED, PROPERTY_TRUE);
end if;
end;
END;
0 comments:
Post a Comment