USE [FastMoneyPro_Remit]
GO
/****** Object:  StoredProcedure [dbo].[proc_addMenu]    Script Date: 7/4/2019 11:35:48 AM ******/
DROP PROCEDURE [dbo].[proc_addMenu]
GO
/****** Object:  StoredProcedure [dbo].[proc_addMenu]    Script Date: 7/4/2019 11:35:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[proc_addMenu]
	 @module			VARCHAR(2)
	,@functionId		VARCHAR(8)	
	,@menuName			VARCHAR(50)
	,@menuDescription	VARCHAR(50)
	,@linkPage			VARCHAR(255)
	,@menuGroup			VARCHAR(50)
	,@position			INT
	,@isActive			CHAR(1)
	,@groupPosition		INT
	,@AgentMenuGroup    VARCHAR(50) = NULL
	,@AgentMenuIcon		VARCHAR(50) = NULL
	
AS


IF NOT EXISTS (SELECT 'X' FROM applicationMenus WHERE functionId = @functionId)
BEGIN	
	INSERT INTO applicationMenus (
		module, functionId, menuName, menuDescription, linkPage, menuGroup, position, isActive, groupPosition,AgentMenuGroup,AgentMenuIcon
	)
	SELECT @module, @functionId, @menuName, @menuDescription, @linkPage, @menuGroup, @position, @isActive, @groupPosition, @AgentMenuGroup,@AgentMenuIcon
	PRINT @menuName  + ' menu added.'		
END



