Click here to Skip to main content
15,882,315 members

Comments by Pradeepkumar patil sonu (Top 29 by date)

Pradeepkumar patil sonu 3-Mar-15 6:19am View    
Reason for my vote of 5 \n it is nice tip.
Pradeepkumar patil sonu 23-Feb-15 1:00am View    
Reason for my vote of 5 \n NIce article
Pradeepkumar patil sonu 23-Feb-15 0:58am View    
Reason for my vote of 5 \n nice article.
Pradeepkumar patil sonu 8-Apr-14 6:08am View    
GO/****** Object: StoredProcedure [dbo].[Check_Availability] Script Date: 04/08/2014 11:26:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[Check_Availability]
@ChkIn int,
@ChkOut int,
@Arrdate1 datetime,
@Arrdate2 datetime,
@ChkInDateTime datetime,
@ChkOutDateTime datetime
AS
BEGIN
SET NOCOUNT ON;
declare @rowcount int
declare @roomtypetemp int
declare @stringtemp varchar(100)
declare @chkintime datetime;
declare @chkouttime datetime;
declare @fromtime varchar(50);
declare @totime varchar(50);
declare @differenceslots int;
set @chkintime=@ChkInDateTime;
set @chkouttime=@ChkOutDateTime;


DECLARE @outTable as Table([Room Type] varchar(20),[Description] varchar(100),[Max No Of People] int,
[No_Of Rooms] int,free int,[Min_Price] varchar(50),PriceType int,[Max No of Childrens] int);

set @fromtime=(select CONVERT(VARCHAR(8),CONVERT(datetime,@ChkInDateTime),108) );
set @totime=(select CONVERT(VARCHAR(8),CONVERT(datetime,@ChkOutDateTime),108) );

declare @RoomType as nvarchar(20),@Description varchar(100), @Noofrooms int,@Noofpersons as int,@PriceType as int,@Minprice decimal(38,20),@freeslots int,@noofchidrens int;

if(@ChkIn=@ChkOut)
set @rowcount=(select count(SlotId) FROM LifeStyleWebAvailability where
(SlotId= @ChkIn) and DocumentType=1 and (AvailabilityDate between @Arrdate1 and @Arrdate2) ) ;
else if(@ChkIn>@ChkOut)
set @rowcount=(select count(SlotId) FROM LifeStyleWebAvailability where
((SlotId between @ChkIn+1 and 23)) and DocumentType=1 and (AvailabilityDate = @Arrdate1))
+
(select count(SlotId) FROM LifeStyleWebAvailability where
((SlotId between 0 and @ChkOut)) and DocumentType=1 and (AvailabilityDate = @Arrdate2));
else
set @rowcount=(select count(SlotId) FROM LifeStyleWebAvailability where
((SlotId between @ChkIn+1 and @ChkOut)) and DocumentType=1 and (AvailabilityDate between @Arrdate1 and @Arrdate2) ) ;

delete from @outTable;
INSERT INTO @outTable([Room Type],[Description],[Max No Of People] ,[No_Of Rooms],[Max No of Childrens])
select [Room Type],[Description],[Max No Of People],[No_Of Rooms],[Max No of Children] from LifeStyleWebRoomType

--if(@fromtime<'10:00:00')
--begin
--set @fromtime=(select SUBSTRING(@fromtime,2,8));
--end
--if(@totime<'10:00:00')
--begin
--set @totime=(select SUBSTRING(@totime,2,8));
--end

print @fromtime;
print @totime;

declare cursor1 cursor for
select [Room Type],[Description],[Max No Of People] ,[No_Of Rooms],[Max No of Childrens] from @outTable
OPEN cursor1
FETCH NEXT FROM cursor1 INTO @RoomType,@Description, @Noofpersons,@Noofrooms,@noofchidrens
WHILE @@FETCH_STATUS = 0
BEGIN
set @PriceType=-1;
set @freeslots=0;
if(EXISTS(Select COUNT(*) from LifeStyleWebRoomPrice where [Room Type]=@RoomType having Count(*)=1))
BEGIN
print 'if'
if( exists(select pricetype from LifeStyleWebRoomPrice where [pricetype]=0 and [Room Type]=@RoomType and
CONVERT(VARCHAR(8),[Valid From],108)<= @fromtime and CONVERT(VARCHAR(8),[Valid To],108)>= @totime and @fromtime<=@totime))
BEGIN
select @PriceType=pricetype,@Minprice=Cast([Min Price] As varchar(50)) from LifeStyleWebRoomPrice where [pricetype]=0 and [Room Type]=@RoomType and
CONVERT(VARCHAR(8),[Valid From],108)<= @fromtime and CONVERT(VARCHAR(8),[Valid To],108)>= @totime and @fromtime<=@totime
END
else if( exists(select pricetype from LifeStyleWebRoomPrice where [pricetype]=1 and [Room Type]=@RoomType and
CONVERT(VARCHAR(8),[Valid From],108)<= @fromtime and CONVERT(VARCHAR(8),[Valid To],108)>= @totime and @fromtime>=@totime))
select @PriceType=pricetype,@Minprice=Cast([Min Price] As varchar(50)) from LifeStyleWebRoomPrice where [pricetype]=1 and [Room Type]=@RoomType and
CONVERT(VARCHAR(8),[Valid From],108)<= @fromtime and CONVERT(VARCHAR(8),[Valid To],108)>= @totime and @fromtime>=@totime

END
ELSE
BEGIN
print 'else 2'
if(EXISTS(SELECT top 1 price2.[Valid From],pric
Pradeepkumar patil sonu 24-Jul-13 6:14am View    
i tried by using Fileinfo but same error m getting