Line 1: #ExternalChecksum("D:\WebsiteMK\mk.net\Search.aspx","{ff1816ec-aa5e-4d10-87f7-6f4963833460}","AE1165DB13CBA2765E1B3FB0C656D387119A5A87")
Line 2: '------------------------------------------------------------------------------
Line 3: ' <auto-generated>
Line 4: ' This code was generated by a tool.
Line 5: ' Runtime Version:4.0.30319.42000
Line 6: '
Line 7: ' Changes to this file may cause incorrect behavior and will be lost if
Line 8: ' the code is regenerated.
Line 9: ' </auto-generated>
Line 10: '------------------------------------------------------------------------------
Line 11:
Line 12: Option Strict Off
Line 13: Option Explicit On
Line 14:
Line 15: Imports Microsoft.VisualBasic
Line 16: Imports System
Line 17: Imports System.Collections
Line 18: Imports System.Collections.Specialized
Line 19: Imports System.Configuration
Line 20: Imports System.Data
Line 21: Imports System.Data.SqlClient
Line 22: Imports System.IO
Line 23: Imports System.Net
Line 24: Imports System.Text
Line 25: Imports System.Text.RegularExpressions
Line 26: Imports System.Web
Line 27: Imports System.Web.Caching
Line 28: Imports System.Web.Profile
Line 29: Imports System.Web.Security
Line 30: Imports System.Web.SessionState
Line 31: Imports System.Web.UI
Line 32: Imports System.Web.UI.HtmlControls
Line 33: Imports System.Web.UI.WebControls
Line 34: Imports System.Web.UI.WebControls.WebParts
Line 35: Imports System.Xml
Line 36:
Line 37: Namespace ASP
Line 38:
Line 39: <System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()> _
Line 40: Public Class search_aspx
Line 41: Inherits Global.System.Web.UI.Page
Line 42: Implements System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler
Line 43:
Line 44: Private Shared __initialized As Boolean
Line 45:
Line 46: Private Shared __stringResource As Object
Line 47:
Line 48: Private Shared __fileDependencies As Object
Line 49:
Line 50:
Line 51: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",74)
Line 52:
Line 53: Dim RowsCount As integer=0
Line 54: Dim pageIndex as Integer=1
Line 55:
Line 56: Public Function GetBookList() As DataTable
Line 57: Dim sSql As String="SELECT TOP 100000 ID,Code, Title, ImageSmall , ImageLarge ,Producer,Author AS AuthorName,Price,Discount,SalePrice,ShopID,IsNew,IsStock,CONVERT(NVARCHAR,IssueDate, 103) AS IssueDate,Description FROM Products WHERE {0} ORDER BY IsStock DESC, CAST( Code AS Numeric) DESC"
Line 58:
Line 59: Dim sWhere As String=" 1=1 "
Line 60: Dim bookKinds As String()={"IsSole","IsNew","IsBestSell","IsPublished"}
Line 61:
Line 62: If Request("bookKind")<>"" then
Line 63: dim iName As Integer=Request("bookKind")
Line 64: sWhere=sWhere & String.Format(" AND {0}=1" ,bookKinds(iName))
Line 65: end if
Line 66:
Line 67: If Request("categoryID")<>"" then sWhere=sWhere & String.Format(" AND CategoryID={0}" ,Request("categoryID"))
Line 68: If Request("eventID")<>"" then sWhere=sWhere & String.Format(" AND SaleOnEvent={0}" ,Request("eventID"))
Line 69:
Line 70: Dim sSearchText As String=trim(Replace(Request("searchText"),"'","''"))
Line 71:
Line 72: Dim hasUnicodeChar As Boolean
Line 73: If Request("shopID")<>"" then
Line 74: Dim idxShop AS Integer=Request("shopID")
Line 75: Select Case idxShop
Line 76: Case -2 'All
Line 77: Case -1 'ISBN
Line 78: sWhere=sWhere & String.Format(" AND Code LIKE N'%{0}%'" ,sSearchText )
Line 79: Case 0 'Author
Line 80: hasUnicodeChar =Helper.IsUnicodeString(sSearchText)
Line 81: If hasUnicodeChar then sWhere=sWhere & String.Format(" AND Author LIKE N'%{0}%'" ,sSearchText ) else sWhere=sWhere & String.Format(" AND AuthorClear LIKE N'%{0}%'" ,sSearchText )
Line 82: Case Else
Line 83: sWhere=sWhere & String.Format(" AND CategoryID IN (SELECT ID FROM Categories WHERE ShopID={0})" ,Request("shopID"))
Line 84: End Select
Line 85: End If
Line 86:
Line 87:
Line 88: If Request("searchText")<>"" AND Request("shopID")<>"-1" AND Request("shopID")<>"0" then
Line 89: hasUnicodeChar =Helper.IsUnicodeString(sSearchText)
Line 90: If hasUnicodeChar then sWhere=sWhere & String.Format(" AND Title LIKE N'%{0}%'" ,sSearchText ) else sWhere=sWhere & String.Format(" AND TitleClear LIKE N'%{0}%'" ,sSearchText )
Line 91: End If
Line 92:
Line 93:
Line 94: sSql=String.Format(sSql,sWhere)
Line 95:
Line 96: Dim sCount As String=Helper.GetSqlCount(sSql)
Line 97: RowsCount=sCount
Line 98: Dim sPage As String=0
Line 99: Dim sPageSize As String=15
Line 100: If Request("pageIndex")<>"" then sPage=Request("pageIndex")
Line 101:
Line 102: Dim t As DataTable =Helper.GetSqlPage(sSql, "ID",sPage,sPageSize, "Products")
Line 103:
Line 104:
Line 105: Helper.ValidateImagePath(Server.MapPath(".."),t)
Line 106:
Line 107: return t
Line 108: End Function
Line 109:
Line 110:
Line 111:
Line 112: #End ExternalSource
Line 113:
Line 114:
Line 115: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Line 116: Public Sub New()
Line 117: MyBase.New
Line 118: Dim dependencies() As String
Line 119: CType(Me,Global.System.Web.UI.Page).AppRelativeVirtualPath = "~/Search.aspx"
Line 120: If (Global.ASP.search_aspx.__initialized = false) Then
Line 121: Global.ASP.search_aspx.__stringResource = Me.ReadStringResource
Line 122: dependencies = New String(0) {}
Line 123: dependencies(0) = "~/Search.aspx"
Line 124: Global.ASP.search_aspx.__fileDependencies = Me.GetWrappedFileDependencies(dependencies)
Line 125: Global.ASP.search_aspx.__initialized = true
Line 126: End If
Line 127: Me.Server.ScriptTimeout = 30000000
Line 128: End Sub
Line 129:
Line 130: Protected ReadOnly Property Profile() As System.Web.Profile.DefaultProfile
Line 131: Get
Line 132: Return CType(Me.Context.Profile,System.Web.Profile.DefaultProfile)
Line 133: End Get
Line 134: End Property
Line 135:
Line 136: Protected ReadOnly Property ApplicationInstance() As System.Web.HttpApplication
Line 137: Get
Line 138: Return CType(Me.Context.ApplicationInstance,System.Web.HttpApplication)
Line 139: End Get
Line 140: End Property
Line 141:
Line 142: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Line 143: Private Sub __BuildControlTree(ByVal __ctrl As search_aspx)
Line 144:
Line 145: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",1)
Line 146: Me.InitializeCulture
Line 147:
Line 148: #End ExternalSource
Line 149: __ctrl.SetRenderMethodDelegate(AddressOf Me.__Render__control1)
Line 150: End Sub
Line 151:
Line 152: Private Sub __Render__control1(ByVal __w As System.Web.UI.HtmlTextWriter, ByVal parameterContainer As System.Web.UI.Control)
Line 153:
Line 154: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",6)
Line 155:
Line 156: If Request("pageIndex")<>"" then pageIndex=Request("pageIndex")
Line 157:
Line 158: Dim sTable As DataTable=GetBookList()
Line 159: sTable.DefaultView.Sort = "IsStock Desc"
Line 160:
Line 161:
Line 162: #End ExternalSource
Line 163: Me.WriteUTF8ResourceString(__w, 16934, 412, false)
Line 164:
Line 165: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",19)
Line 166: __w.Write(rowsCount)
Line 167:
Line 168:
Line 169: #End ExternalSource
Line 170: __w.Write("</span> mục"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" </td><td align=""right""><span class=""linkitem"" style=""cursor:poin"& _
Line 171: "ter;padding-right:10px"">"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"<span><a href=""""><b>« </b></a></span> "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
Line 172:
Line 173: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",24)
Line 174:
Line 175: Dim pageCount as Integer=rowsCount\15
Line 176: Dim currentPageIndex As String=Request("pageIndex")
Line 177: if currentPageIndex="" then currentPageIndex="0"
Line 178:
Line 179: For i As Integer=currentPageIndex to 6
Line 180: if i >=pageCount then exit for
Line 181: Dim queryParam As String=String.Format("pageIndex={0}&categoryID={1}&bookKind={2}&SearchText={3}&shopID={4}&eventID={5}",i,Request("categoryID"),Request("bookKind"),Request("SearchText"),Request("ShopID"),Request("EventID"))
Line 182: If i=pageIndex then
Line 183:
Line 184:
Line 185: #End ExternalSource
Line 186: __w.Write(" "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" <a href=""index.aspx?")
Line 187:
Line 188: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",34)
Line 189: __w.Write(queryParam)
Line 190:
Line 191:
Line 192: #End ExternalSource
Line 193: __w.Write("""><b>[")
Line 194:
Line 195: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",34)
Line 196: __w.Write(i)
Line 197:
Line 198:
Line 199: #End ExternalSource
Line 200: __w.Write("]</b></a> |"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
Line 201:
Line 202: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",35)
Line 203: Else
Line 204:
Line 205: #End ExternalSource
Line 206: __w.Write(" "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" <a href=""index.aspx?")
Line 207:
Line 208: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",36)
Line 209: __w.Write(queryParam)
Line 210:
Line 211:
Line 212: #End ExternalSource
Line 213: __w.Write(""">")
Line 214:
Line 215: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",36)
Line 216: __w.Write(i)
Line 217:
Line 218:
Line 219: #End ExternalSource
Line 220: __w.Write(" </a> |"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
Line 221:
Line 222: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",38)
Line 223: End If
Line 224: Next
Line 225:
Line 226: #End ExternalSource
Line 227: __w.Write(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" <a href=""""><b>»</b></a></span></td></tr></table> "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"</div>"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)& _
Line 228: " <div>"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
Line 229:
Line 230: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",45)
Line 231:
Line 232: 'For each r as DataRow in sTable.Rows
Line 233:
Line 234: For Each rowView As DataRowView in sTable.DefaultView
Line 235: Dim r As DataRow = rowView.Row
Line 236:
Line 237:
Line 238:
Line 239:
Line 240: #End ExternalSource
Line 241: __w.Write(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"<br />"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"<table>"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" <tr><td valign=""top""><img src=""/")
Line 242:
Line 243: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",55)
Line 244: __w.Write(r("ImageLarge"))
Line 245:
Line 246:
Line 247: #End ExternalSource
Line 248: __w.Write(""" class=""frameLarge""/></td>"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" <td valign=""top"" style=""padding-left:3px""><sp"& _
Line 249: "an class=""linkitem"" ><a href=""index.aspx?q=view&isbn=")
Line 250:
Line 251: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",57)
Line 252: __w.Write(r("Code"))
Line 253:
Line 254:
Line 255: #End ExternalSource
Line 256: __w.Write("""><b>")
Line 257:
Line 258: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",57)
Line 259: __w.Write(r("Title"))
Line 260:
Line 261:
Line 262: #End ExternalSource
Line 263: __w.Write("</b> </a><br /></span><span style=""color:#000;""> ")
Line 264:
Line 265: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",57)
Line 266: __w.Write(r("AuthorName"))
Line 267:
Line 268:
Line 269: #End ExternalSource
Line 270: __w.Write("</span>"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" (<b>ISBN</b>: ")
Line 271:
Line 272: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",58)
Line 273: __w.Write(r("Code"))
Line 274:
Line 275:
Line 276: #End ExternalSource
Line 277: __w.Write(")<br />"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
Line 278:
Line 279: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",59)
Line 280: __w.Write(Helper.GetShortContent(r("Description"),500))
Line 281:
Line 282:
Line 283: #End ExternalSource
Line 284: __w.Write(" "&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"</td>"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"</tr>"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"</table>"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
Line 285:
Line 286: #ExternalSource("D:\WebsiteMK\mk.net\Search.aspx",65)
Line 287: Next
Line 288:
Line 289: #End ExternalSource
Line 290: __w.Write(""&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" </div>"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&" </div>"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"</div>"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10))
Line 291: End Sub
Line 292:
Line 293: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Line 294: Protected Overrides Sub FrameworkInitialize()
Line 295: MyBase.FrameworkInitialize
Line 296: Me.SetStringResourcePointer(Global.ASP.search_aspx.__stringResource, 0)
Line 297: Me.__BuildControlTree(Me)
Line 298: Me.AddWrappedFileDependencies(Global.ASP.search_aspx.__fileDependencies)
Line 299: Me.Request.ValidateInput
Line 300: End Sub
Line 301:
Line 302: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Line 303: Public Overrides Function GetTypeHashCode() As Integer
Line 304: Return -950543551
Line 305: End Function
Line 306:
Line 307: <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Line 308: Public Overrides Sub ProcessRequest(ByVal context As System.Web.HttpContext)
Line 309: MyBase.ProcessRequest(context)
Line 310: End Sub
Line 311: End Class
Line 312: End Namespace
Line 313:
|