Click here to Skip to main content
15,886,110 members
Articles / Programming Languages / C#

Genesis Hybrid Smart Client Framework part III

Rate me:
Please Sign up or sign in to vote.
4.29/5 (10 votes)
19 Jun 2009Ms-PL10 min read 34K   7  
This is part III of a VII part series. This article covers the back-end of the Genesis Smart Client Framework including the database design.
��USE [BlueMarble.Genesis.Dev]



/****** Object:  StoredProcedure [dbo].[Module_BarItem_Find]    Script Date: 05/20/2009 22:37:08 ******/

SET ANSI_NULLS OFF

GO

SET QUOTED_IDENTIFIER ON

GO

/*

----------------------------------------------------------------------------------------------------

-- Date Created: 20 May 2007



-- Created By: Eliyahu Business Systems (http://www.eliyahu.co.za)

-- Purpose: Finds records in the Module_BarItem table passing nullable parameters

----------------------------------------------------------------------------------------------------

*/





CREATE PROCEDURE [dbo].[Module_BarItem_Find]

(



	@SearchUsingOR bit   = null ,



	@BarItemGuid uniqueidentifier   = null ,



	@BarItemId int   = null ,



	@ParentBarItemGuid uniqueidentifier   = null ,



	@RibbonBarGuid uniqueidentifier   = null ,



	@CommandGuid uniqueidentifier   = null ,



	@BarItemName nvarchar (128)  = null ,



	@BarItemImage nvarchar (1024)  = null ,



	@BarItemImageSize int   = null ,



	@BarItemTypeId int   = null ,



	@BarItemOrder int   = null 

)

AS





				

  IF ISNULL(@SearchUsingOR, 0) <> 1

  BEGIN

    SELECT

	  [BarItemGuid]

	, [BarItemId]

	, [ParentBarItemGuid]

	, [RibbonBarGuid]

	, [CommandGuid]

	, [BarItemName]

	, [BarItemImage]

	, [BarItemImageSize]

	, [BarItemTypeId]

	, [BarItemOrder]

    FROM

	dbo.[Module_BarItem]

    WHERE 

	 ([BarItemGuid] = @BarItemGuid OR @BarItemGuid is null)

	AND ([BarItemId] = @BarItemId OR @BarItemId is null)

	AND ([ParentBarItemGuid] = @ParentBarItemGuid OR @ParentBarItemGuid is null)

	AND ([RibbonBarGuid] = @RibbonBarGuid OR @RibbonBarGuid is null)

	AND ([CommandGuid] = @CommandGuid OR @CommandGuid is null)

	AND ([BarItemName] = @BarItemName OR @BarItemName is null)

	AND ([BarItemImage] = @BarItemImage OR @BarItemImage is null)

	AND ([BarItemImageSize] = @BarItemImageSize OR @BarItemImageSize is null)

	AND ([BarItemTypeId] = @BarItemTypeId OR @BarItemTypeId is null)

	AND ([BarItemOrder] = @BarItemOrder OR @BarItemOrder is null)

						

  END

  ELSE

  BEGIN

    SELECT

	  [BarItemGuid]

	, [BarItemId]

	, [ParentBarItemGuid]

	, [RibbonBarGuid]

	, [CommandGuid]

	, [BarItemName]

	, [BarItemImage]

	, [BarItemImageSize]

	, [BarItemTypeId]

	, [BarItemOrder]

    FROM

	dbo.[Module_BarItem]

    WHERE 

	 ([BarItemGuid] = @BarItemGuid AND @BarItemGuid is not null)

	OR ([BarItemId] = @BarItemId AND @BarItemId is not null)

	OR ([ParentBarItemGuid] = @ParentBarItemGuid AND @ParentBarItemGuid is not null)

	OR ([RibbonBarGuid] = @RibbonBarGuid AND @RibbonBarGuid is not null)

	OR ([CommandGuid] = @CommandGuid AND @CommandGuid is not null)

	OR ([BarItemName] = @BarItemName AND @BarItemName is not null)

	OR ([BarItemImage] = @BarItemImage AND @BarItemImage is not null)

	OR ([BarItemImageSize] = @BarItemImageSize AND @BarItemImageSize is not null)

	OR ([BarItemTypeId] = @BarItemTypeId AND @BarItemTypeId is not null)

	OR ([BarItemOrder] = @BarItemOrder AND @BarItemOrder is not null)

	Select @@ROWCOUNT			

  END

GO

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
We Fix Code
South Africa South Africa
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions