﻿Partial Class Products_Details
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim Product = Request.Item("product")
        If Product Is Nothing Then Return

        SqlDataSource1.SelectCommand = "SELECT ystock, ybrand, ydesc, ydesc1, yspec, RTRIM(ylink) as ylink, ylinktext" _
        & " FROM stockw" _
        & " WHERE stockw.ystock = '" & Product & "'"

        Dim Img = Request.PhysicalApplicationPath & "Img\HardWare\" & Product.Trim & ".jpg"
        Dim ImgA = Request.PhysicalApplicationPath & "Img\HardWare\" & Product.Trim & "A.jpg"
        FormView2.Visible = System.IO.File.Exists(Img)
        FormView4.Visible = System.IO.File.Exists(ImgA)


    End Sub

    Public Shared Function yspec(ByVal spec As Object) As String
        If Not spec.GetType.Equals(GetType(String)) Then Return ""

        Dim zyspec As String = ""
        zyspec = System.Web.HttpUtility.HtmlEncode(spec).Replace(Chr(13), "<br />").Trim
        Return zyspec

    End Function
End Class
