PDA

View Full Version : سوال: جستجو پیشرفته و ترکیبی



itloveh
پنج شنبه 25 اردیبهشت 1393, 12:56 عصر
با سلام
در سایتم میخواستم جستجو پیشرفته و ترکیبی رو بنویسم که دیدم با if و overloading امکانش نیست با تعداد حالاتی که وجود دارد آیا راه حل دیگه ای هست ؟
کامپاننتی برای این کار هست ؟
اگر هست ممنون میشم راهنماییم کنید.:ناراحت:

rezadana
پنج شنبه 25 اردیبهشت 1393, 15:13 عصر
سلام به لینک زیر برید میتونه بهتون کمک کنه. موفق باشید.
http://www.aparat.com/v/1SuPK


ـــــــــــــــــــــــــ ـــــــــــــــــــــــــ ـ
www.rezalynda.rzb.ir

rezadana
پنج شنبه 25 اردیبهشت 1393, 15:17 عصر
این تاپیک رو هم نگاه کن.
http://barnamenevis.org/showthread.php?317646-جستجو-سایت&p=1393842&viewfull=1#post1393842

itloveh
جمعه 26 اردیبهشت 1393, 19:08 عصر
دوست عزیز من به دستورات sql اشنا هستم اما در جستجو ممکن است بر اساس یک گزینه جستجو انحام شود یا دو مقدار و یا سه مقدار و یا ...که باید بگیم اگر بر اساس این گزینه بود با این دستورات و با گزینه دیگر این دستورات و ترکیب این دو یا بیشتر مقدار این دستورات را اجرا کن.
ممنون از کمکتون

itloveh
جمعه 26 اردیبهشت 1393, 19:09 عصر
دوست عزیز من به دستورات sql اشنا هستم اما در جستجو ممکن است بر اساس یک گزینه جستجو انحام شود یا دو مقدار و یا سه مقدار و یا ...که باید بگیم اگر بر اساس این گزینه بود با این دستورات و با گزینه دیگر این دستورات و ترکیب این دو یا بیشتر مقدار این دستورات را اجرا کن.
ممنون از کمکتون

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

itloveh
جمعه 26 اردیبهشت 1393, 22:24 عصر
گفتند باید کامپوننت استفاده کنم اما کامپوننت از کجا بگیرم ؟ :متفکر:

javad13
یک شنبه 28 اردیبهشت 1393, 19:41 عصر
سلام ،من متوجه اشتباهم شدم ، نیازی به کامپوننت نیست ، ببینید مقادیری که به استور پروسیجر پاس میشه برای من برای مقادیر فارسی همراه با N هست که من در شروطم چک نکرده بودمشون ، لذا همین باعث میشد دستورات if من به درستی کار نکنند.
اگر از sqlprofiler استفاده کنی متوجه اشتباهت میشی دوست عزیز.