Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
8| Name | Data Type | Length | Description |
|---|---|---|---|
| @p_accion | varchar | 20 | |
| @p_webID | varchar | 10 | |
| @p_title | varchar | 100 | |
| @p_userID | int | 4 | |
| @p_dependency | int | 4 | |
| @p_routeaddr | varchar | 150 | |
| @p_active | bit | 1 | |
| @p_id_menu_item | int | 4 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER PROCEDURE dbo.menu_items_
@p_accion varchar(20), /* LIST_ITEMS / ADD_MENU_ITEM / UPD_MENU_ITEM */
@p_webID varchar(10), /* PLATAFORMAS IVBACK - FIDEBACK - ETC */
@p_title varchar(100), /* TITULO DEL ITEM */
@p_userID int, /* EL USUARIO QUE ESTA ADMINISTRANDO LOS DATOS */
@p_dependency int = NULL, /* EL ITEM DEL CUAL DEPENDE */
@p_routeaddr varchar(150) = null, /* RUTA DE ACCESO DEL ITEM */
@p_active bit = 1,
@p_id_menu_item int =null /*ID DEL ITEM DE MENU QUE SE ESTÁ ACTUALIZANDO */
AS
BEGIN
SET NOCOUNT ON;
/*
select * from users_menu
select * from menu_items
*/
if (upper(@p_accion) = 'LIST_ITEMS')
BEGIN
SELECT MI.id_menu_item, MI.id_plataforma, MI.item_title, MI.dependent_item, MI.routeaddr, MI.active AS mi_active
/*,MIDEP.item_title as dep_title */
FROM menu_items MI
/*LEFT JOIN menu_items AS MIDEP ON MI.dependent_item = MIDEP.id_menu_item*/
WHERE (MI.id_plataforma = @p_webID)
ORDER BY mi.item_title asc
END
if (upper(@p_accion) = 'ADD_MENU_ITEM')
BEGIN
INSERT INTO menu_items (created,created_by, active,id_plataforma,item_title,dependent_item,routeaddr)
values (getdate(),@p_userID, @p_active, @p_webID, @p_title, @p_dependency,@p_routeaddr)
END
if (upper(@p_accion) = 'UPD_MENU_ITEM')
BEGIN
update menu_items set modified_by=@p_userID,modified=getdate(),active=@p_active,id_plataforma=@p_webID,item_title=upper(@p_title),dependent_item=@p_dependency,routeaddr=@p_routeaddr
where id_menu_item= @p_id_menu_item
END
END
GO
GO
CREATE OR ALTER PROCEDURE dbo.menu_items_
@p_accion varchar(20), /* LIST_ITEMS / ADD_MENU_ITEM / UPD_MENU_ITEM */
@p_webID varchar(10), /* PLATAFORMAS IVBACK - FIDEBACK - ETC */
@p_title varchar(100), /* TITULO DEL ITEM */
@p_userID int, /* EL USUARIO QUE ESTA ADMINISTRANDO LOS DATOS */
@p_dependency int = NULL, /* EL ITEM DEL CUAL DEPENDE */
@p_routeaddr varchar(150) = null, /* RUTA DE ACCESO DEL ITEM */
@p_active bit = 1,
@p_id_menu_item int =null /*ID DEL ITEM DE MENU QUE SE ESTÁ ACTUALIZANDO */
AS
BEGIN
SET NOCOUNT ON;
/*
select * from users_menu
select * from menu_items
*/
if (upper(@p_accion) = 'LIST_ITEMS')
BEGIN
SELECT MI.id_menu_item, MI.id_plataforma, MI.item_title, MI.dependent_item, MI.routeaddr, MI.active AS mi_active
/*,MIDEP.item_title as dep_title */
FROM menu_items MI
/*LEFT JOIN menu_items AS MIDEP ON MI.dependent_item = MIDEP.id_menu_item*/
WHERE (MI.id_plataforma = @p_webID)
ORDER BY mi.item_title asc
END
if (upper(@p_accion) = 'ADD_MENU_ITEM')
BEGIN
INSERT INTO menu_items (created,created_by, active,id_plataforma,item_title,dependent_item,routeaddr)
values (getdate(),@p_userID, @p_active, @p_webID, @p_title, @p_dependency,@p_routeaddr)
END
if (upper(@p_accion) = 'UPD_MENU_ITEM')
BEGIN
update menu_items set modified_by=@p_userID,modified=getdate(),active=@p_active,id_plataforma=@p_webID,item_title=upper(@p_title),dependent_item=@p_dependency,routeaddr=@p_routeaddr
where id_menu_item= @p_id_menu_item
END
END
GO
Depends On
1Used By
No items found