javad13
جمعه 26 اردیبهشت 1393, 19:27 عصر
سلام
من هم همین مشکل رو دارم ، در واقع یک فرم جستجو دارم که چند تا dropdownlist داره و دوتا تکس بکس و یک checkbox اما با استور پروسیجر و دستور if ، به نتیجه نمیرسم و مشکل از اونجاست که فکر میکنم دستورات if زیاد شده و درواقع آخرین دستور if اجرا میشه
اینم استور پروسیجر من :
USE [Auto]
GO
/****** Object: StoredProcedure [dbo].[Search5] Script Date: 05/16/2014 18:58:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[Search5](@valuedrNoKhodro int,@valueOstan tinyint,@valueModel nvarchar(50),@strSefr tinyint,@Otagh nvarchar(50),@bitchkPic bit,@strGheymat nvarchar(50),@strTagheymat nvarchar(50))
as
begin
declare @v_strfiltter bit
if(@valuedrNoKhodro =0 and @valueOstan =1 and @Otagh='هم' and len(@strTagheymat)=0 )
begin
select TG.id_User, (select t1.PicUrl from tbl_Gallery as T1 where
T1.id_User=TG.id_User and t1.id_Gallery=TG.F1)as PicUrl,
tbl_Auto.AutoName,tbl_Auto.Girbox,tbl_Auto.Karkard ,tbl_Auto.MiladiYear, dbo.tbl_Auto.Vizhe , dbo.tbl_Auto.Sefr,dbo.tbl_Auto.id_Auto,tbl_Auto.Ti tle,tbl_Auto.Price
from tbl_Auto
inner join (select id_user,max(id_Gallery) as F1 from tbl_Gallery
group by id_User ) as TG on tbl_Auto.id_User =TG.id_User Where tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
else if(@valuedrNoKhodro !=0 and @valueOstan =1 and @Otagh='هم' and len(@strTagheymat)=0 )
begin
if(@valueModel = 'همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType=@valuedrNoKhodro and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
else if(@valueModel !='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType=@valuedrNoKhodro and tbl_Auto.AutoName=@valueModel and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
end
else if(@valuedrNoKhodro =0 and @valueOstan !=1 and @Otagh='هم' and len(@strTagheymat)=0 )
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.Ostan=@valueOstan and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
else if(@valuedrNoKhodro =0 and @valueOstan =1 and @Otagh !='هم' and len(@strTagheymat)=0 )
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.Otagh=@Otagh and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
else if(@valuedrNoKhodro =0 and @valueOstan =1 and @Otagh ='هم' and len(@strTagheymat)!=0 )
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where Price <= @strTagheymat and tbl_Auto.Price >= @strGheymat and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
else if(@valuedrNoKhodro !=0 and @valueOstan !=1 and @Otagh !='هم' and LEN(@strTagheymat)!=0)
begin
if(@valueModel ='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType=@valuedrNoKhodro and tbl_Auto.Ostan=@valueOstan and tbl_Auto.Otagh=@Otagh and (tbl_Auto.Price<=@strTagheymat and tbl_Auto.Price>=@strGheymat) and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
if(@valueModel !='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType=@valuedrNoKhodro and tbl_Auto.AutoName=@valueModel and tbl_Auto.Ostan=@valueOstan and Otagh=@Otagh and (tbl_Auto.Price<=@strTagheymat and tbl_Auto.Price>=@strGheymat) and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
end
else if(@valuedrNoKhodro !=0 and @valueOstan !=1 and @Otagh !='هم' and LEN(@strTagheymat) =0)
begin
if(@valueModel ='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType = @valuedrNoKhodro and tbl_Auto.Ostan=@valueOstan and tbl_Auto.Otagh=@Otagh and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
if(@valueModel !='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType=@valuedrNoKhodro and tbl_Auto.AutoName=@valueModel and tbl_Auto.Ostan=@valueOstan and tbl_Auto.Otagh=@Otagh and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
end
else if(@valuedrNoKhodro !=0 and @valueOstan !=1 and @Otagh = 'هم' and LEN(@strTagheymat) !=0)
begin
if(@valueModel ='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType=@valuedrNoKhodro and tbl_Auto.Ostan=@valueOstan and (tbl_Auto.Price <=@strTagheymat and tbl_Auto.Price >= @strGheymat) and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
if(@valueModel !='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType=@valuedrNoKhodro and tbl_Auto.AutoName=@valueModel and tbl_Auto.Ostan=@valueOstan and (tbl_Auto.Price <=@strTagheymat and tbl_Auto.Price >= @strGheymat) and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
end
else if(@valuedrNoKhodro !=0 and @valueOstan !=1 and @Otagh = 'هم' and LEN(@strTagheymat) =0)
begin
if(@valueModel ='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType =@valuedrNoKhodro and tbl_Auto.Ostan=@valueOstan and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
if(@valueModel !='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType=@valuedrNoKhodro and tbl_Auto.AutoName =@valueModel and tbl_Auto.Ostan=@valueOstan and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
end
else if(@valuedrNoKhodro !=0 and @valueOstan =1 and @Otagh !='هم' and LEN(@strTagheymat)!=0)
begin
if(@valueModel ='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType=@valuedrNoKhodro and tbl_Auto.Otagh=@Otagh and (tbl_Auto.Price<=@strTagheymat and tbl_Auto.Price >=@strGheymat) and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
if(@valueModel !='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType=@valuedrNoKhodro and tbl_Auto.AutoName=@valueModel and tbl_Auto.Otagh=@Otagh and (tbl_Auto.Price<=@strTagheymat and tbl_Auto.Price >=@strGheymat) and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
end
else if(@valuedrNoKhodro !=0 and @valueOstan =1 and @Otagh !='هم' and LEN(@strTagheymat)=0)
begin
if(@valueModel ='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType=@valuedrNoKhodro and tbl_Auto.Otagh=@Otagh and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
if(@valueModel !='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType=@valuedrNoKhodro and tbl_Auto.AutoName=@valueModel and tbl_Auto.Otagh=@Otagh and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
end
else if(@valuedrNoKhodro !=0 and @valueOstan =1 and @Otagh ='هم' and LEN(@strTagheymat)!=0)
begin
if(@valueModel ='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType=@valuedrNoKhodro and (tbl_Auto.Price>=@strGheymat and tbl_Auto.Price<=@strTagheymat) and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
if(@valueModel !='همه')
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.id_AutoType=@valuedrNoKhodro and tbl_Auto.AutoName=@valueModel and (tbl_Auto.Price>=@strGheymat and tbl_Auto.Price<=@strTagheymat) and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
end
else if(@valuedrNoKhodro =0 and @valueOstan !=1 and @Otagh !='هم' and LEN(@strTagheymat)!=0)
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.Ostan=@valueOstan and tbl_Auto.Otagh=@Otagh and (tbl_Auto.Price>=@strGheymat and tbl_Auto.Price<=@strTagheymat) and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
else if(@valuedrNoKhodro =0 and @valueOstan !=1 and @Otagh !='هم' and LEN(@strTagheymat)=0)
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.Ostan=@valueOstan and tbl_Auto.Otagh=@Otagh and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
else if(@valuedrNoKhodro =0 and @valueOstan !=1 and @Otagh ='هم' and LEN(@strTagheymat)!=0)
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where tbl_Auto.Ostan=@valueOstan and (tbl_Auto.Price>=@strGheymat and tbl_Auto.Price<=@strTagheymat) and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
else if(@valuedrNoKhodro =0 and @valueOstan =1 and @Otagh ='هم' and LEN(@strTagheymat)!=0)
begin
select distinct tbl_Auto.id_User, tbl_Auto.AutoName , tbl_Auto.DateEngheza , tbl_Auto.DateIn , tbl_Auto.Description,tbl_Auto.Girbox , tbl_Auto.Karkard , tbl_Auto.Mehvar , tbl_Auto.MiladiYear , tbl_Auto.Mobile , tbl_Auto.Model , tbl_Auto.Ostan , tbl_Auto.Otagh , tbl_Auto.Price , tbl_Auto.RangBadane , tbl_Auto.RangTodozi , tbl_Auto.Sefr , tbl_Auto.ShamsiYear , tbl_Auto.Sokht , tbl_Auto.TedadDoor , tbl_Auto.TedadSilandr,tbl_Auto.Tell , tbl_Auto.Title , tbl_Auto.id_AutoType , tbl_Auto.id_Gallery, tbl_Auto.id_Namayeshgah , tbl_Auto.id_Register , tbl_Auto.id_Auto , tbl_Gallery.PicUrl from tbl_Auto inner join tbl_Gallery on tbl_Auto.id_User=tbl_Gallery.id_User where (tbl_Auto.Price>=@strGheymat and tbl_Auto.Price <=@strTagheymat) and tbl_Auto.Sefr =@strSefr and tbl_Auto.id_Gallery=@bitchkPic
end
end
vBulletin® v4.2.5, Copyright ©2000-1403, Jelsoft Enterprises Ltd.