USE [Isterahat_DB] GO /****** Object: Table [isterahat].[Tbl_GuestHouse_Info] Script Date: 18-May-16 12:03:23 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [isterahat].[Tbl_GuestHouse_Info]( [GuesthouseID] [int] IDENTITY(1,1) NOT NULL, [GuesthouseName] [nvarchar](200) NULL, [ContactDetails] [nvarchar](max) NULL, [Latitude] [varchar](200) NULL, [Longitude] [varchar](200) NULL, [Description] [nvarchar](max) NULL, [TopImage] [nvarchar](200) NULL, [CreatedDate] [datetime] NULL, [ModifiedDate] [datetime] NULL, CONSTRAINT [PK_Tbl_GuestHouse_Info] PRIMARY KEY CLUSTERED ( [GuesthouseID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [isterahat].[Tbl_GuesthouseFeatures] Script Date: 18-May-16 12:03:24 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [isterahat].[Tbl_GuesthouseFeatures]( [FeaturesID] [int] IDENTITY(1,1) NOT NULL, [GuesthouseID] [int] NULL, [Featuresname] [nvarchar](max) NULL, [FeatureImg] [nvarchar](max) NULL, [CreatedDate] [datetime] NULL, [ModifiedDate] [datetime] NULL, CONSTRAINT [PK_Tbl_GuesthouseFeatures] PRIMARY KEY CLUSTERED ( [FeaturesID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET IDENTITY_INSERT [isterahat].[Tbl_GuestHouse_Info] ON INSERT [isterahat].[Tbl_GuestHouse_Info] ([GuesthouseID], [GuesthouseName], [ContactDetails], [Latitude], [Longitude], [Description], [TopImage], [CreatedDate], [ModifiedDate]) VALUES (18, N'New GuestHouse', N'1-25/377 Road No 12, Banjarahills, Hyderabad-500030, India', N'17.410286', N'78.437593', N'There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomi', N'ban5441ed3da-5395-49d1-96df-d32138e48a8a.jpg', CAST(N'2016-04-29 06:12:51.410' AS DateTime), CAST(N'2016-05-16 03:37:49.907' AS DateTime)) INSERT [isterahat].[Tbl_GuestHouse_Info] ([GuesthouseID], [GuesthouseName], [ContactDetails], [Latitude], [Longitude], [Description], [TopImage], [CreatedDate], [ModifiedDate]) VALUES (19, N'villa', N'Nandyal', N'15.4786', N'78.4831', N'villa is for family and all parties', N'pic2d3c2a857-c3ac-42b6-9bfc-54e011746586.jpg', CAST(N'2016-04-29 06:55:25.313' AS DateTime), CAST(N'2016-05-12 00:12:31.630' AS DateTime)) INSERT [isterahat].[Tbl_GuestHouse_Info] ([GuesthouseID], [GuesthouseName], [ContactDetails], [Latitude], [Longitude], [Description], [TopImage], [CreatedDate], [ModifiedDate]) VALUES (29, N'Guest House', N'Vijayawada', N'16.5062', N'80.6480', N'providing mariages and parites', N'ser_pic16177b27c-a438-4c6b-979a-a93cf4a9a8a3.jpg', CAST(N'2016-05-02 02:46:59.493' AS DateTime), CAST(N'2016-05-12 00:37:04.003' AS DateTime)) INSERT [isterahat].[Tbl_GuestHouse_Info] ([GuesthouseID], [GuesthouseName], [ContactDetails], [Latitude], [Longitude], [Description], [TopImage], [CreatedDate], [ModifiedDate]) VALUES (37, N'Form house', N'Anantapur', N'14.6842', N'77.5878', N'accepting all parties and functions', N'ser_pic28c0ced64-3b6f-4a8f-a5af-918ba9ccf38a.jpg', CAST(N'2016-05-09 02:15:05.323' AS DateTime), CAST(N'2016-05-13 04:39:13.900' AS DateTime)) INSERT [isterahat].[Tbl_GuestHouse_Info] ([GuesthouseID], [GuesthouseName], [ContactDetails], [Latitude], [Longitude], [Description], [TopImage], [CreatedDate], [ModifiedDate]) VALUES (40, N'Jeddah Guest House', N'545454545', N'21.484741', N'39.2547686', N'This is a test', N'commercial25b3aca78-d4b9-4cb1-9a3f-156b5d4880db.jpg', CAST(N'2016-05-14 05:06:13.980' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuestHouse_Info] ([GuesthouseID], [GuesthouseName], [ContactDetails], [Latitude], [Longitude], [Description], [TopImage], [CreatedDate], [ModifiedDate]) VALUES (1054, N'Isteraha', N'SSKZ', N' 21°54''38.58"N', N' 39° 4''42.20"E', N'Beach House', N'images2c05ae70-c604-4681-8655-254813fb71b8.jpg', CAST(N'2016-05-17 13:30:10.880' AS DateTime), NULL) SET IDENTITY_INSERT [isterahat].[Tbl_GuestHouse_Info] OFF SET IDENTITY_INSERT [isterahat].[Tbl_GuesthouseFeatures] ON INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (99, 19, N'Wifi', N'icon5686c5b6d-a371-4210-a53f-7b45734b22b6.jpg', CAST(N'2016-05-12 00:12:31.960' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (100, 19, N'Park', N'icon2ee5ec7b3-e20a-405f-817e-633f563a284c.jpg', CAST(N'2016-05-12 00:12:31.960' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (111, 29, N'Basketball Court ', N'icon185f84c20-01c8-42f0-a01b-00a038963799.jpg', CAST(N'2016-05-12 00:37:04.230' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (112, 29, N'Gardens', N'icon244f73d17-c514-4c15-94ee-f0439ced741c.jpg', CAST(N'2016-05-12 00:37:04.230' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (113, 29, N'TV', N'icon4de95a8b3-de4c-42e0-b70d-a82b588c17f1.jpg', CAST(N'2016-05-12 00:37:04.230' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (147, 37, N'Play Ground', N'icon20b887a88-022d-47d3-b60a-7018b6074c28.jpg', CAST(N'2016-05-13 04:39:14.213' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (148, 37, N'wifi', N'icon5f7a978d4-5100-4b49-8cac-bce3d830b954.jpg', CAST(N'2016-05-13 04:39:14.213' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (149, 37, N'swimming', N'icon3adfee759-712a-4524-9432-eb9ffe0c9bf6.jpg', CAST(N'2016-05-13 04:39:14.213' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (155, 40, N'football', N'514878996-b80b-4625-996f-ff3ae2fb794b.png', CAST(N'2016-05-14 05:06:14.670' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (1185, 18, N'wifi', N'icon5cb98023b-8c67-4c75-83ec-d445e0a51d92.jpg', CAST(N'2016-05-16 03:37:50.490' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (1186, 18, N'Basketball Court', N'icon14f20bf9a-fc87-4841-a4fb-ef3a705ecfa1.jpg', CAST(N'2016-05-16 03:37:50.490' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (1187, 18, N'Swimming Pool', N'icon32866c1e0-4311-43cb-8735-75d0ed7e67c7.jpg', CAST(N'2016-05-16 03:37:50.490' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (1188, 18, N'Play Ground', N'icon28a4eaa61-1bc5-4682-aadb-a9c0aec19821.jpg', CAST(N'2016-05-16 03:37:50.490' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (1189, 18, N'TV', N'icon4a9aca2ba-b434-4022-8efe-d28b42d03572.jpg', CAST(N'2016-05-16 03:37:50.490' AS DateTime), NULL) INSERT [isterahat].[Tbl_GuesthouseFeatures] ([FeaturesID], [GuesthouseID], [Featuresname], [FeatureImg], [CreatedDate], [ModifiedDate]) VALUES (1191, 1054, N'', N'images18663e3d-8e57-4d37-8794-900cfda42a84.jpg', CAST(N'2016-05-17 13:30:11.143' AS DateTime), NULL) SET IDENTITY_INSERT [isterahat].[Tbl_GuesthouseFeatures] OFF /****** Object: StoredProcedure [isterahat].[Sp_Search_GUstH_Featu] Script Date: 18-May-16 12:03:26 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE Proc [isterahat].[Sp_Search_GUstH_Featu]--null,null,null,null,null,null,null,null,null,null,null (@GuesthouseID varchar(200)=null,@GuesthouseName varchar(200)=null,@Feature1 varchar(200)=null,@Feature2 varchar(200)=null, @Feature3 varchar(200)=null,@Feature4 varchar(200)=null,@Feature5 varchar(200)=null,@Feature6 varchar(200)=null, @Feature7 varchar(200)=null,@Feature8 varchar(200)=null,@Feature9 varchar(200)=null) as begin select a.FeatureImg,a.Featuresname from Tbl_GuesthouseFeatures as a left join Tbl_GuestHouse_Info as b on a.GuesthouseID=b.GuesthouseID where ((a.GuesthouseID=@GuesthouseID) or (@GuesthouseID is null)) or ((b.GuesthouseName=@GuesthouseName) or( @GuesthouseName is null)) or ((a.Featuresname=@Feature1) or (@Feature1 is null)) or ((a.FeaturesID=@Feature2) or (@Feature2 is null)) or ((a.Featuresname=@Feature3) or (@Feature3 is null)) or ((a.Featuresname=@Feature4) or (@Feature4 is null)) or ((a.Featuresname=@Feature5) or (@Feature5 is null)) or ((a.Featuresname=@Feature6) or (@Feature6 is null)) or ((a.Featuresname=@Feature7) or (@Feature7 is null)) or ((a.Featuresname=@Feature8) or (@Feature8 is null)) or ((a.Featuresname=@Feature9) or (@Feature9 is null)) end GO