Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Imports System.Drawing
Imports QueryString
Imports System
Partial Class UserControl_ProductDetails_Buyer
    Inherits System.Web.UI.UserControl
    Dim cmd As New SqlCommand
    Dim dr As SqlDataReader
    Dim dr1 As SqlDataReader
    Dim con As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("ConnectionString"))
    Dim prodcode As String
    Dim SpecialPrice As Decimal = 0.0
    '    Dim dcodestr As New QueryString
    Dim dtCategoryDistinct As DataTable
    Dim dtbtnMSG As DataTable
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        prodcode = DecodeURL((RemoveLiterals(Request.QueryString("ProductCode"))))

        'temporary checking the control with this static productid
        'prodcode = ReturnValue("select Product_Kid from Product_Information where Product_Code='AAF047'")

        If Not IsPostBack Then


            If IsNothing(CatDistinct) Then
                GetCatDistinct()
            End If
            dtCategoryDistinct = CatDistinct

            Session("BtnInformation") = Nothing

            Try
                lnkTellAFriend.Attributes.Add("onclick", "return OpenTellFriend();")
                lnkprice.Attributes.Add("onclick", "return openform('" & (RemoveLiterals(Request.QueryString("ProductCode"))) & "');")
                lnkButton.Attributes.Add("onclick", "return OpenFrm();")
                Img1.Attributes.Add("onclick", "return OpenFrm();")
                lnktax.Attributes.Add("onclick", "return openformtax();")
                lnkInquiry.Attributes.Add("onclick", "return openinquiry('" & (RemoveLiterals(Request.QueryString("ProductCode"))) & "');")
                lnkproductAlert.Attributes.Add("onclick", "return OpenProductAlert('" & RemoveLiterals(Request.QueryString("ProductCode")) & "');")
                'lnkseevideo.Attributes.Add("onclick", "return OpenVedio();")

                Session("ProductCode") = (RemoveLiterals(Request.QueryString("ProductCode")))
                Session("FromWishList") = (RemoveLiterals(Request.QueryString("FromWishList")))

                If (Session("FromWishList") = "1") Then
                    lnkAddtoWishList.Text = "Back to Wish List"
                Else
                    lnkAddtoWishList.Text = "Add to Wish List"
                End If

                Dim con As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("ConnectionString"))
                Dim str As String = "SELECT Product_Name,Product_Description,Product_CategoryId FROM Product_Information WHERE Product_Kid = '" & prodcode & "'"
                Dim sda1 As New SqlDataAdapter(str, con)
                Dim ds1 As New DataSet
                sda1.Fill(ds1)


                ' this function will display the path where u r ?
                'fillURL(ds1.Tables(0).Rows(0)(2).ToString())
                fillURL1(ds1.Tables(0).Rows(0)(2).ToString())   'without any link

                tdProductName.InnerHtml = "<a style='color:#155799' href ='" & Request.RawUrl & "'>" & ds1.Tables(0).Rows(0)(0).ToString() & "</a>"

                'lblProductName.Text = "Product Name : " & ds1.Tables(0).Rows(0)(0).ToString()
                If ds1.Tables(0).Rows(0)(1).ToString().Trim = "" Then

                    trproduct.Visible = False
                Else
                    trproduct.Visible = True

                    tdproduct.InnerHtml = ds1.Tables(0).Rows(0)(1).ToString().Trim
                    tdproduct.NoWrap = False
                End If

            
                prodetails()
                ' System.Threading.Thread.Sleep(5000)
                dtbtnMSG = ReturnDataTable("Select * from button_msg_master where categoryid='" & RemoveLiterals(ds1.Tables(0).Rows(0)(2).ToString()) & "'")
                TechnicalSpecification()

                GiveImageURL()
                displaynone()

                imgmouseoverbyr()

                ds1.Clear()
            Catch ex As Exception
                showmessage(ex.Message.ToString, lblerror)
            End Try
        End If



    End Sub

    Public Sub imgmouseoverbyr()
        Try
            ImgApplication.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgCatalog.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgConsumables.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgFeatures.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgGuarantyWarranty.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgIncludedAccess.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgInstallationCommissioning.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgMSDS.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgOptionalAccess.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgPackagingDetails.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgProductStandardApproval.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgSpareParts.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgSpecialNotes.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgTechSpecification.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgUserManual.Attributes.Add("onmouseover", "return mousehand(this);")
            ImgWearAndTear.Attributes.Add("onmouseover", "return mousehand(this);")


            ImgApplication.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblApplication.ClientID.ToString & "');")
            ImgCatalog.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblCatalog.ClientID.ToString & "');")
            ImgConsumables.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblConsumables.ClientID.ToString & "');")
            ImgFeatures.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblFeature.ClientID.ToString & "');")
            ImgGuarantyWarranty.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblGarantyWaranty.ClientID.ToString & "');")
            ImgIncludedAccess.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblIncludedAccess.ClientID.ToString & "');")
            ImgInstallationCommissioning.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblInstComm.ClientID.ToString & "');")
            ImgMSDS.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblMSDS.ClientID.ToString & "');")
            ImgOptionalAccess.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblOptionalAccess.ClientID.ToString & "');")
            ImgPackagingDetails.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblPackaging.ClientID.ToString & "');")
            ImgProductStandardApproval.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblStandardApproval.ClientID.ToString & "');")
            ImgSpareParts.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblSpareParts.ClientID.ToString & "');")
            ImgSpecialNotes.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblSpecialNotes.ClientID.ToString & "');")
            ImgTechSpecification.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblTechSpeci.ClientID.ToString & "');")
            ImgUserManual.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblUserManual.ClientID.ToString & "');")
            ImgWearAndTear.Attributes.Add("onclick", "return imgmouseoverbyr(this,'" & tblWearAndTear.ClientID.ToString & "');")

            ImgApplication.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblApplication.ClientID.ToString & "');")
            ImgCatalog.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblCatalog.ClientID.ToString & "');")
            ImgConsumables.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblConsumables.ClientID.ToString & "');")
            ImgFeatures.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblFeature.ClientID.ToString & "');")
            ImgGuarantyWarranty.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblGarantyWaranty.ClientID.ToString & "');")
            ImgIncludedAccess.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblIncludedAccess.ClientID.ToString & "');")
            ImgInstallationCommissioning.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblInstComm.ClientID.ToString & "');")
            ImgMSDS.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblMSDS.ClientID.ToString & "');")
            ImgOptionalAccess.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblOptionalAccess.ClientID.ToString & "');")
            ImgPackagingDetails.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblPackaging.ClientID.ToString & "');")
            ImgProductStandardApproval.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblStandardApproval.ClientID.ToString & "');")
            ImgSpareParts.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblSpareParts.ClientID.ToString & "');")
            ImgSpecialNotes.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblSpecialNotes.ClientID.ToString & "');")
            ImgTechSpecification.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblTechSpeci.ClientID.ToString & "');")
            ImgUserManual.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblUserManual.ClientID.ToString & "');")
            ImgWearAndTear.Attributes.Add("onmouseout", "return imgmouseoutbyr(this,'" & tblWearAndTear.ClientID.ToString & "');")


        Catch ex As Exception
            showmessage(ex.Message.ToString, lblerror)
        End Try
    End Sub


   
    Public Sub displaynone()
        Try
            tblApplication.Style.Add("display", "none")
            tblCatalog.Style.Add("display", "none")
            tblConsumables.Style.Add("display", "none")
            tblFeature.Style.Add("display", "none")
            tblGarantyWaranty.Style.Add("display", "none")
            tblInstallationManual.Style.Add("display", "none")
            tblInstComm.Style.Add("display", "none")
            tblMSDS.Style.Add("display", "none")
            tblPackaging.Style.Add("display", "none")
            tblSpecialNotes.Style.Add("display", "none")
            tblStandardApproval.Style.Add("display", "none")
            tblTechSpeci.Style.Add("display", "none")

            tblOptionalAccess.Style.Add("display", "none")
            tblIncludedAccess.Style.Add("display", "none")
            tblUserManual.Style.Add("display", "none")
            tblWearAndTear.Style.Add("display", "none")
            tblSpareParts.Style.Add("display", "none")
        Catch ex As Exception
            showmessage(ex.Message.ToString, lblerror)
        End Try
    End Sub

    Public Sub GiveImageURL()
        'ImgApplication.ImageUrl = Page.ResolveUrl("~/images/buttons/B04-Applications.gif")
        'ImgCatalog.ImageUrl = Page.ResolveUrl("~/images/buttons/B21-Catalog.gif")
        'ImgConsumables.ImageUrl = Page.ResolveUrl("~/images/buttons/B23-Consum.gif")
        'ImgFeatures.ImageUrl = Page.ResolveUrl("~/images/buttons/B03-Features.gif")
        'ImgGuarantyWarranty.ImageUrl = Page.ResolveUrl("~/images/buttons/B16-GuaWarranty.gif")
        'ImgIncludedAccess.ImageUrl = Page.ResolveUrl("~/images/buttons/B07-Acce-Inclu.gif")
        'ImgInstallationCommissioning.ImageUrl = Page.ResolveUrl("~/images/buttons/B12-Insta-Comm.gif")
        'ImgMSDS.ImageUrl = Page.ResolveUrl("~/images/buttons/B06-Product-MSDS.gif")
        'ImgOptionalAccess.ImageUrl = Page.ResolveUrl("~/images/buttons/B08-Opt-Acces.gif")
        'ImgPackagingDetails.ImageUrl = Page.ResolveUrl("~/images/buttons/B17-Pack-Details.gif")
        'ImgProductStandardApproval.ImageUrl = Page.ResolveUrl("~/images/buttons/B14-Prod-Stand.gif")
        'ImgSpareParts.ImageUrl = Page.ResolveUrl("~/images/buttons/B24-Spares.gif")
        'ImgSpecialNotes.ImageUrl = Page.ResolveUrl("~/images/buttons/B05-Spe-Instru.gif")
        'ImgTechSpecification.ImageUrl = Page.ResolveUrl("~/images/buttons/B02-TechSpec.gif")
        'ImgUserManual.ImageUrl = Page.ResolveUrl("~/images/buttons/B04-Applications.gif")
        'ImgWearAndTear.ImageUrl = Page.ResolveUrl("~/images/buttons/B10-ListWear.gif")

    End Sub
    Public Sub fillURL1(ByVal Cat_KID As String)
        Try
            Dim dr() As DataRow
            dr = dtCategoryDistinct.Select("Category_KId='" & Cat_KID & "'")
            Dim url As String
            url = ""
            If dr.Length = 0 Then
                'tdURL.InnerHtml += "<a style='color:#155799' href='" & ResolveUrl("~/main/" & EncodeURL(RemoveLiterals(Cat_KID.ToString)) & "/" & ReturnValue("Select CategoryName from Category_Distinct where Category_Kid='" & RemoveLiterals(Cat_KID.ToString) & "'") & ".aspx") & "' >" & ReturnValue("Select Category_Name from Category_Distinct where Category_KId ='" & RemoveLiterals(Cat_KID.ToString) & "'") & "</a> > "
                lblpath.Text += ReturnValue("Select CategoryName from Category_Distinct where Category_Kid='" & RemoveLiterals(Cat_KID.ToString) & "'") & " > " & ReturnValue("Select Category_Name from Category_Distinct where Category_KId ='" & RemoveLiterals(Cat_KID.ToString) & "'")
                Session("MainCat") = RemoveLiterals(Cat_KID.ToString)
                Exit Sub
            Else
                Dim dr1() As DataRow
                dr1 = dr
                While dr1.Length <> 0
                    'dr(0).Item("Category_Kid").ToString & "/" & dr(0).Item("ParentName").ToString & "/" & dr(0).Item("CategoryName").ToString & "' > " & 
                    url += " > " & dr(0).Item("Category_Name").ToString & " | "
                    dr = dtCategoryDistinct.Select("Category_KId='" & dr1(0).Item("Category_ParentId") & "'")
                    If dr.Length = 0 Then
                        'dr1(0).Item("Category_ParentId") & "/" & dr1(0).Item("ParentName").ToString & " > " &
                        url += dr1(0).Item("Category_ParentName").ToString
                    End If
                    dr1 = dr
                End While
            End If

            lblpath.Text += "<a href='newBuyerSearch.aspx'><b>Product Category </b></a> > <span style='color:#155799'>"
            Dim url1() As String
            url1 = url.Split("|")
            Array.Reverse(url1)

            Dim i As Integer
            For i = 0 To url1.Length - 1
                If i = 0 Then
                    lblpath.Text += url1(0).ToString
                    Continue For
                Else

                    If i = url1.Length - 1 Then
                        lblpath.Text += url1(i).Replace("JJJ", "category")
                    Else
                        lblpath.Text += url1(i).Replace("JJJ", "s" & i + 1)
                    End If
                End If
            Next
            lblpath.Text += "</span>"
        Catch ex As Exception
            showmessage(ex.Message.ToString, lblerror)
        End Try
    End Sub
    Public Sub fillURL(ByVal Cat_KID As String)
        Try
            Dim dr() As DataRow
            dr = dtCategoryDistinct.Select("Category_KId='" & Cat_KID & "'")
            Dim url As String
            url = ""
            If dr.Length = 0 Then
                tdURL.InnerHtml += "<a style='color:#155799' href='" & ResolveUrl("~/main/" & EncodeURL(RemoveLiterals(Cat_KID.ToString)) & "/" & ReturnValue("Select CategoryName from Category_Distinct where Category_Kid='" & RemoveLiterals(Cat_KID.ToString) & "'") & ".aspx") & "' >" & ReturnValue("Select Category_Name from Category_Distinct where Category_KId ='" & RemoveLiterals(Cat_KID.ToString) & "'") & "</a> > "
                'lblpath.Text += ResolveUrl("~/main/" & EncodeURL(RemoveLiterals(Cat_KID.ToString)) & "/" & ReturnValue("Select CategoryName from Category_Distinct where Category_Kid='" & RemoveLiterals(Cat_KID.ToString) & "'") & ".aspx") & "' >" & ReturnValue("Select Category_Name from Category_Distinct where Category_KId ='" & RemoveLiterals(Cat_KID.ToString) & "'")
                Session("MainCat") = RemoveLiterals(Cat_KID.ToString)
                Exit Sub
            Else
                Dim dr1() As DataRow
                dr1 = dr
                While dr1.Length <> 0
                    url += "<a style='color:#155799' href='" & ResolveUrl("~/JJJ/" & EncodeURL(dr(0).Item("Category_Kid").ToString) & "/" & dr(0).Item("ParentName").ToString & "/" & dr(0).Item("CategoryName").ToString & ".aspx") & "' > " & dr(0).Item("Category_Name").ToString & "</a> > | "
                    dr = dtCategoryDistinct.Select("Category_KId='" & dr1(0).Item("Category_ParentId") & "'")
                    If dr.Length = 0 Then
                        url += "<a style='color:#155799' href='" & ResolveUrl("~/main/" & EncodeURL(RemoveLiterals(dr1(0).Item("Category_ParentId"))) & "/" & dr1(0).Item("ParentName").ToString & ".aspx") & "' >" & dr1(0).Item("Category_ParentName").ToString & "</a> > "
                    End If
                    dr1 = dr
                End While
            End If

            tdURL.InnerHtml = "<a href='newBuyerSearch.aspx'><b>Product Category > </b></a><span style='color:#155799'>"
            Dim url1() As String
            url1 = url.Split("|")
            Array.Reverse(url1)

            Dim i As Integer
            For i = 0 To url1.Length - 1
                If i = 0 Then
                    tdURL.InnerHtml += url1(0).ToString
                    Continue For
                Else

                    If i = url1.Length - 1 Then
                        tdURL.InnerHtml += url1(i).Replace("JJJ", "category")
                    Else
                        tdURL.InnerHtml += url1(i).Replace("JJJ", "s" & i + 1)
                    End If
                End If
            Next
            tdURL.InnerHtml += "</span>"

            Dim str As String
            str = "Hello"


        Catch ex As Exception
            showmessage(ex.Message.ToString, lblerror)
        End Try

    End Sub




    Private Sub prodetails()
        '------------------For Product Image,Code,Price,Model No----------------
        Try
            
            Dim imgpath As String = ""

            'cmd = New SqlCommand("select isnull(Product_AtcoPrice,'0') as [Product_AtcoPrice] ,product_image,Product_Code,Product_ModelNo,Product_weight,Product_Dimension,Product_MinOrderQty,Product_ShippingQty,Product_DeliveryPeriod,Product_DeliveryPeriodType,Product_SpecialPrice,Product_DimensionUnitId,Product_MinOrderQtyType,Product_ShippingQtyType,Product_PcsPerKg,Product_weightunitid from product_master where product_kid='" & prodcode & "'", con)

            cmd = New SqlCommand("SELECT     Product_Code, Product_Name, Product_MarketPrice, Product_Image, Product_BrandId, Product_ModelNo, Product_MinOrderQty, Product_ShippingQty, Product_Weight, Product_Dimension, Product_PcsPerKg, Product_DeliveryPeriod FROM Compare_product where product_kid='" & prodcode & "'", con)
            If con.State = ConnectionState.Open Then
                con.Close()
            End If
            con.Open()
            dr = cmd.ExecuteReader
            While dr.Read
               
                Img1.ImageUrl = ResolveUrl("~/Upload Image/Product Image/UploadImages/") & dr(3)
                imgpath = ResolveUrl(Server.MapPath("~/Upload Image/Product Image/UploadImages/" & dr(3)))

                Dim str As String
                'str = Request.RawUrl.Substring(Request.RawUrl.LastIndexOf("/"), Request.RawUrl.LastIndexOf("."))
                str = Path.GetFileName(Request.RawUrl)
                Img1.ToolTip = dr(1).ToString
                Img1.AlternateText = dr(1).ToString


                Dim f As New IO.FileInfo(imgpath)
                If f.Exists = False Then
                    lnkButton.Visible = False
                End If

                KeepAspectRatioNew(Img1, imgpath, 225, 200)
                'unitid = dr(9).ToString()
                'dimId = dr(11).ToString()
                'selltype = dr(12).ToString()
                'Shiptype = dr(13).ToString()
                'Wunitid = dr(15).ToString()
                If dr(0).ToString = "" Then
                    lblprodcode.Text = NoDataAvail
                Else
                    lblprodcode.Text = dr(0).ToString
                End If
                If dr(5).ToString = "" Then
                    lblmfrmodel.Text = NoDataAvail
                Else
                    lblmfrmodel.Text = dr(5).ToString
                End If

                If dr(8).ToString = "" Or dr(8).ToString.Contains("0.00") Then
                    lblshipwght.Text = NoDataAvail
                    lblwght.Text = ""
                Else
                    lblshipwght.Text = dr(8).ToString
                    lblwght.Text = ""
                    'lblwght.Text = ReturnValue("select Unit_Name from unit_master where Unit_kid='" & Wunitid & "'")     'shipwght Unit Name
                End If

                If dr(9).ToString = "" Or dr(9).ToString.Contains("0 X 0 X 0") Or dr(9).ToString.Contains("0X0X0") Then
                    lblshipdime.Text = NoDataAvail
                    lbldid.Text = ""
                Else
                    lblshipdime.Text = dr(9).ToString
                    lbldid.Text = ""
                    'lbldid.Text = ReturnValue("select Unit_Name from unit_master where Unit_kid='" & dimId & "'")  'Dimension Unit Name
                End If

                If dr(6).ToString = "" Or dr(6).ToString.Contains("0.00") Then
                    lblsellqty.Text = NoDataAvail
                Else
                    lblsellqty.Text = dr(6).ToString()
                    'lblselltype.Text = ReturnValue("select Unit_Name from unit_master where Unit_kid='" & selltype & "'")    'Sell Qty Unit Name
                End If
                If dr(7).ToString = "" Or dr(7).ToString.Contains("0.00") Then
                    lblshipqty.Text = NoDataAvail
                Else
                    lblshipqty.Text = dr(7).ToString()
                    ' lblshiptype.Text = ReturnValue("select Unit_Name from unit_master where Unit_kid='" & Shiptype & "'")  'Ship Qty Unit Name
                End If
                If dr(11).ToString = "" Then
                    lbldespatch.Text = NoDataAvail
                Else
                    lbldespatch.Text = dr(11).ToString()
                    'lbldesu.Text = ReturnValue("select Unit_Name from unit_master where Unit_kid='" & unitid & "'") 'delivery Period Unit Name
                End If
                If dr(10).ToString = "" Or dr(10).ToString = "0" Then
                    lblpcs.Text = NoDataAvail
                Else
                    lblpcs.Text = dr(10).ToString()
                End If

                If dr.Item("Product_MarketPrice").ToString = "" Or dr.Item("Product_MarketPrice").ToString.Contains("0.00") Then
                    SpecialPrice = 0.0
                Else
                    SpecialPrice = dr.Item("Product_MarketPrice").ToString.Replace("Rs. ", "")
                End If

            End While
            con.Close()

            lblprice.Text = "Rs. " & Producttotalprice(prodcode)
            If lblprice.Text.ToString = "" Or lblprice.Text.ToString.Contains(" 0.00") Or lblprice.Text.ToString.Contains(" 0") Then
                lblprice.Visible = False
                lnkprice.Visible = True

            Else
                lblprice.Visible = True
                lnkprice.Visible = False
                lnktax.Visible = True
                Dim strProductVatKID As String
                strProductVatKID = ReturnValue("Select ProductVat_Kid from ProductVat where ProductVat_ProductId='" & RemoveLiterals(prodcode.ToString) & "' and ProductVat_IsDeleted='0'")
                If strProductVatKID = "" Or strProductVatKID = Nothing Then
                    lnktax.Visible = False
                    lblprice.Text += "  (Inclusive of all taxes.)"
                End If

            End If
            'If lblprice.Text.ToString = "" Or lblprice.Text.ToString.Contains(" 0.00") Or lblprice.Text.ToString.Contains(" 0") Then
            '    lnktax.Visible = False
            'Else
            '    lnktax.Visible = True
            'End If
            Dim isostr As String
            isostr = ReturnValue("SELECT     Supplier_Master.Supplier_IsISO FROM Product_Master INNER JOIN Supplier_Master ON Product_Master.Product_SupplierId = Supplier_Master.Supplier_Kid WHERE   Product_Master.Product_Kid = '" & prodcode & "'")
            If isostr = "Y" Then
                lbliso1.Visible = True
                lbliso1.ImageUrl = Page.ResolveUrl("~/Images/iso_logo.gif")
            Else
                lbliso1.Visible = False
            End If
            '------------------For Product Brand Name----------------
            'con.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("ConnectionString")
            cmd = New SqlCommand("select Brand_Name from ProductDisplay where product_kid='" & prodcode & "'", con)
            If con.State = ConnectionState.Open Then
                con.Close()
            End If
            con.Open()
            dr = cmd.ExecuteReader
            While dr.Read
                'lblwght.Text = dr(0).ToString
                lblbrand.Text = dr(0).ToString
            End While
            con.Close()
            dr.Close()
            Session("ProductCode") = prodcode     'The Session("ProductCode") value is going to the ProductInformationData.aspx page to show the Product Information Data.
        Catch ex As Exception
            showmessage(ex.Message.ToString, lblerror)
        End Try
    End Sub

    'Private Sub Unit_Name(ByVal str As String, ByRef label As Label)
    '    Try
    '        'con.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("ConnectionString")
    '        ' Dim dr2 As SqlDataReader
    '        cmd = New SqlCommand("select Unit_Name from unit_master where Unit_kid='" & str & "'", con)
    '        If con.State = ConnectionState.Open Then
    '            con.Close()
    '        End If
    '        con.Open()
    '        dr = cmd.ExecuteReader
    '        While dr.Read
    '            label.Text = dr(0).ToString
    '        End While
    '        con.Close()
    '        ' dr2.Close()
    '    Catch ex As Exception
    '    End Try
    'End Sub



    Protected Function ShopCartProcedure(ByVal StrMode As String, ByVal prodid As String) As Boolean
        Try
            Dim shopid As String = NewPrimaryKeyUserControl(Me)
            shopid = RemoveLiterals(shopid)
            Dim shopCode As String = Generate_Code("select count(*) from ShopCart where ShopCart_Code='", "SC")
            Dim con As New SqlConnection                        'Define connection variable for connecting to SQL-Server
            con.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("ConnectionString")    'Read the ConnectionString from web.config File
            Dim cmd As New SqlCommand
            con.Open()
            Dim sqlcol As Data.SqlClient.SqlParameterCollection = cmd.Parameters
            sqlcol.Add("@ShopCart_Kid", SqlDbType.NVarChar, 10).Value = shopid.Trim
            sqlcol.Add("@ShopCart_Code", SqlDbType.NVarChar, 25).Value = shopCode.Trim
            sqlcol.Add("@ShopCart_ProductId", SqlDbType.NVarChar, 10).Value = prodid
            sqlcol.Add("@ShopCart_BuyerUserId", SqlDbType.NVarChar, 25).Value = Session("BuyId")
            sqlcol.Add("@ShopCart_Quantity", SqlDbType.Int).Value = 1
            sqlcol.Add("@ShopCart_SpecialPrice", SqlDbType.Decimal, 18).Value = SpecialPrice
            sqlcol.Add("@ShopCart_FinancialYearId", SqlDbType.NVarChar, 10).Value = "2007"
            sqlcol.Add("@ShopCart_CompanyId", SqlDbType.NVarChar, 10).Value = Session("companyId")
            sqlcol.Add("@ShopCart_UserId", SqlDbType.NVarChar, 10).Value = Session("UserId")
            sqlcol.Add("@FormName", SqlDbType.NVarChar, 50).Value = Me.Page.ToString
            sqlcol.Add("@Mode", SqlDbType.VarChar, 10).Value = StrMode.Trim
            ExecQuery("ShopCart_Proc", sqlcol).StartsWith("True")
            sqlcol = Nothing
            cmd = Nothing
            Return True
        Catch ex As Exception
            showmessage(ex.Message.ToString, lblerror)
        End Try
    End Function

    Protected Sub WishListProcedure(ByVal StrMode As String, ByVal prodid As String)
        Try
            Dim wishlistid As String = NewPrimaryKeyUserControl(Me)
            wishlistid = RemoveLiterals(wishlistid)
            Dim wishlistCode As String = Generate_Code("select count(*) from AddWishList where AddWishList_Code='", "WL")
            Dim con As New SqlConnection                        'Define connection variable for connecting to SQL-Server
            con.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("ConnectionString")    'Read the ConnectionString from web.config File
            Dim cmd As New SqlCommand
            con.Open()
            Dim str As String = "select AddWishList_Code from AddWishList where AddWishList_ProductId='" & prodid & "' and AddWishList_BuyerUserId='" & Session("BuyId") & "'"
            Dim da As New SqlDataAdapter(str, con)
            Dim ds As New DataSet
            da.Fill(ds)
            If ds.Tables(0).Rows.Count > 0 Then
                If lnkAddtoWishList.Text = "Back to Wish List" Then
                    Response.Redirect("~/Buyer/WishList.aspx")
                Else
                    CreateMessageAlert(Me.Page, "This Product Already Added in WishList.", "StrKeyVal")
                    Exit Sub
                End If
                
            Else
                Dim sqlcol As Data.SqlClient.SqlParameterCollection = cmd.Parameters
                sqlcol.Add("@AddWishList_Kid", SqlDbType.NVarChar, 10).Value = wishlistid.Trim
                sqlcol.Add("@AddWishList_Code", SqlDbType.NVarChar, 25).Value = wishlistCode.Trim
                sqlcol.Add("@AddWishList_ProductId", SqlDbType.NVarChar, 10).Value = prodid
                sqlcol.Add("@AddWishList_BuyerUserId", SqlDbType.NVarChar, 25).Value = Session("BuyId")
                sqlcol.Add("@AddWishList_FinancialYearId", SqlDbType.NVarChar, 10).Value = Now.Year
                sqlcol.Add("@AddWishList_CompanyId", SqlDbType.NVarChar, 10).Value = Session("companyId")
                sqlcol.Add("@AddWishList_UserId", SqlDbType.NVarChar, 10).Value = Session("UserId")
                sqlcol.Add("@FormName", SqlDbType.NVarChar, 50).Value = Me.Page.ToString
                sqlcol.Add("@Mode", SqlDbType.VarChar, 10).Value = StrMode.Trim
                ExecQuery("AddWishList_Proc", sqlcol).StartsWith("True")
                sqlcol = Nothing
                cmd = Nothing
                Response.Redirect("~/Buyer/WishList.aspx")
                ' Dim gvRow As GridViewRow
            End If
        Catch ex As Exception
            showmessage(ex.Message.ToString, lblerror)
        End Try
    End Sub

    Protected Sub lnkCompareProducts_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkCompareProducts.Click
        Response.Redirect("~/Buyer/buyer_compare.aspx?Product_Id=" & prodcode)
    End Sub

    Protected Sub lnkBuynow_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkBuynow.Click

        If Session("BuyId") = Nothing Then
            Response.Redirect("~/Buyer/BuyerLogin.aspx")
        Else
            'Dim shoptabel As New DataTable
            'shoptabel.Columns.Add("ProductId")

            'Dim shrow As DataRow = shoptabel.NewRow

            'shrow("ProductId") = prodcode
            'shoptabel.Rows.Add(shrow)

            'Session("Checkstatus") = "ShopCart"
            'Session("ShopTabel") = shoptabel
            ShopCartProcedure("Insert", prodcode)
            Response.Redirect("~/Buyer/ShopCart.aspx")
        End If

    End Sub

    Protected Sub lnkAddtoWishList_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkAddtoWishList.Click
        Try
            Dim Wishtabel As New DataTable
            Wishtabel.Columns.Add("ProductId")

            If Session("BuyId") = Nothing Then
                Response.Redirect("~/Buyer/BuyerLogin.aspx")

            Else
                'Session("Checkstatus") = "WishLsit"
                'Dim wsrow As DataRow = Wishtabel.NewRow
                'wsrow("ProductId") = prodcode
                'Wishtabel.Rows.Add(wsrow)
                'Session("WishTabel") = Wishtabel
                WishListProcedure("Insert", prodcode)

            End If
        Catch ex As Exception
            showmessage(ex.Message.ToString, lblerror)
        End Try
    End Sub
   


    Public Sub TechnicalSpecification()
        getApplication()
        getUserManual()
        ' System.Threading.Thread.Sleep(5000)
        getFeature()
        ' System.Threading.Thread.Sleep(5000)
        getTechSpeci()
        getIncAcc()
        GetSpecialNotes()
        getMSDS()
        getConsumables()
        getCatalog()
        getStandardApproval()
        getInstallationManual()
        getGarantyWaranty()
        getPackaging()
        getInstCommission()
        getAccOptional()
        getSpareParts()
        getWearAndTear()
    End Sub
    Public Sub getWearAndTear()
        Dim wtdt As DataTable
        wtdt = ReturnDataTable("SELECT     OtherDetail_SpareParts.ODTSP_kid, ProductDisplay.ProdName, ProductDisplay.CatName, ProductDisplay.Product_Name,         ProductDisplay.Product_ModelNo, ProductDisplay.Product_AtcoPrice, ProductDisplay.Brand_Name , ProductDisplay.Product_KId, ProductDisplay.Product_Image, ProductDisplay.Product_Code FROM         OtherDetail_SpareParts INNER JOIN                       ProductDisplay ON OtherDetail_SpareParts.ODTSP_SparePartId = ProductDisplay.Product_Kid WHERE     (OtherDetail_SpareParts.ODTSP_ProductId = '" & RemoveLiterals(Session("ProductCode").ToString) & "') AND (OtherDetail_SpareParts.ODTSP_IsDeleted = N'0') and ProductDisplay.Product_IsWear_Tear='y'")
        'optdt = ReturnDataTable("SELECT     OtherDetail_OptionalAccessories.ODTOA_kid, Product_Master.Product_Name, Product_Master.Product_Image,Product_Master.Product_AtcoPrice, Product_Master.Product_Code, Product_Master.Product_ModelNo FROM         OtherDetail_OptionalAccessories INNER JOIN                       Product_Master ON OtherDetail_OptionalAccessories.ODTOA_OAccessId = Product_Master.Product_Kid WHERE     (OtherDetail_OptionalAccessories.ODTOA_ProductId = N'" & RemoveLiterals(Session("ProductCode").ToString) & "') AND (OtherDetail_OptionalAccessories.ODTOA_IsDeleted = N'0') AND                        (Product_Master.Product_IsDeleted = N'0')")
        gvWearAndTear.DataSource = wtdt
        gvWearAndTear.DataBind()
        If wtdt.Rows.Count = 0 Then
            gvWearAndTear.Visible = False
            TdWearAndTear2.InnerHtml = "<ul>"
            If dtbtnMSG.Rows.Count > 0 Then
                TdWearAndTear2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("Wear_Tear").ToString & "</li>"
            Else
                TdWearAndTear2.InnerHtml += "<li> There are currently no Wear and Tear parts for this product.</li>"
            End If
            TdWearAndTear2.InnerHtml += "</ul>"
        End If
    End Sub
    Public Sub getSpareParts()
        Dim spdt As DataTable
        spdt = ReturnDataTable("SELECT     OtherDetail_SpareParts.ODTSP_kid, ProductDisplay.ProdName, ProductDisplay.CatName, ProductDisplay.Product_Name,         ProductDisplay.Product_ModelNo, ProductDisplay.Product_AtcoPrice, ProductDisplay.Brand_Name , ProductDisplay.Product_KId, ProductDisplay.Product_Image, ProductDisplay.Product_Code FROM         OtherDetail_SpareParts INNER JOIN                       ProductDisplay ON OtherDetail_SpareParts.ODTSP_SparePartId = ProductDisplay.Product_Kid WHERE     (OtherDetail_SpareParts.ODTSP_ProductId = '" & RemoveLiterals(Session("ProductCode").ToString) & "') AND (OtherDetail_SpareParts.ODTSP_IsDeleted = N'0')")
        'optdt = ReturnDataTable("SELECT     OtherDetail_OptionalAccessories.ODTOA_kid, Product_Master.Product_Name, Product_Master.Product_Image,Product_Master.Product_AtcoPrice, Product_Master.Product_Code, Product_Master.Product_ModelNo FROM         OtherDetail_OptionalAccessories INNER JOIN                       Product_Master ON OtherDetail_OptionalAccessories.ODTOA_OAccessId = Product_Master.Product_Kid WHERE     (OtherDetail_OptionalAccessories.ODTOA_ProductId = N'" & RemoveLiterals(Session("ProductCode").ToString) & "') AND (OtherDetail_OptionalAccessories.ODTOA_IsDeleted = N'0') AND                        (Product_Master.Product_IsDeleted = N'0')")
        gvSpareParts.DataSource = spdt
        gvSpareParts.DataBind()
        If spdt.Rows.Count = 0 Then
            gvSpareParts.Visible = False
            TdSpareParts2.InnerHtml = "<ul>"
            If dtbtnMSG.Rows.Count > 0 Then
                TdSpareParts2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("SpareParts").ToString & "</li>"
            Else
                TdSpareParts2.InnerHtml += "<li> There are currently no SpareParts for this product.</li>"
            End If
            TdSpareParts2.InnerHtml += "</ul>"
        End If
    End Sub
    Public Sub getIncAcc()
        Dim incdt As DataTable
        incdt = ReturnDataTable("SELECT     OtherDetail_IncludedAccessories.ODTIA_kid, ProductDisplay.ProdName, ProductDisplay.CatName, ProductDisplay.Product_Name,         ProductDisplay.Product_ModelNo, ProductDisplay.Product_AtcoPrice, ProductDisplay.Brand_Name , ProductDisplay.Product_KId, ProductDisplay.Product_Image, ProductDisplay.Product_Code FROM         OtherDetail_IncludedAccessories INNER JOIN                       ProductDisplay ON OtherDetail_IncludedAccessories.ODTIA_InAccessId = ProductDisplay.Product_Kid WHERE     (OtherDetail_IncludedAccessories.ODTIA_ProductId = '" & RemoveLiterals(Session("ProductCode").ToString) & "') AND (OtherDetail_IncludedAccessories.ODTIA_IsDeleted = N'0')")
        'optdt = ReturnDataTable("SELECT     OtherDetail_OptionalAccessories.ODTOA_kid, Product_Master.Product_Name, Product_Master.Product_Image,Product_Master.Product_AtcoPrice, Product_Master.Product_Code, Product_Master.Product_ModelNo FROM         OtherDetail_OptionalAccessories INNER JOIN                       Product_Master ON OtherDetail_OptionalAccessories.ODTOA_OAccessId = Product_Master.Product_Kid WHERE     (OtherDetail_OptionalAccessories.ODTOA_ProductId = N'" & RemoveLiterals(Session("ProductCode").ToString) & "') AND (OtherDetail_OptionalAccessories.ODTOA_IsDeleted = N'0') AND                        (Product_Master.Product_IsDeleted = N'0')")
        gvIncAcc.DataSource = incdt
        gvIncAcc.DataBind()

        If incdt.Rows.Count = 0 Then
            gvIncAcc.Visible = False
            TdIncludedAccess2.InnerHtml = "<ul>"
            If dtbtnMSG.Rows.Count > 0 Then
                TdIncludedAccess2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("IncludedAccessories").ToString & "</li>"
            Else
                TdIncludedAccess2.InnerHtml += "<li> There are currently no Included Accessories for this product.</li>"
            End If
            TdIncludedAccess2.InnerHtml += "</ul>"
        End If

    End Sub
    Public Sub getAccOptional()
        Dim optdt As DataTable
        optdt = ReturnDataTable("SELECT     OtherDetail_OptionalAccessories.ODTOA_kid, ProductDisplay.ProdName, ProductDisplay.CatName, ProductDisplay.Product_Name,         ProductDisplay.Product_ModelNo, ProductDisplay.Product_AtcoPrice, ProductDisplay.Brand_Name , ProductDisplay.Product_KId, ProductDisplay.Product_Image, ProductDisplay.Product_Code FROM         OtherDetail_OptionalAccessories INNER JOIN                       ProductDisplay ON OtherDetail_OptionalAccessories.ODTOA_OAccessId = ProductDisplay.Product_Kid WHERE     (OtherDetail_OptionalAccessories.ODTOA_ProductId = '" & RemoveLiterals(Session("ProductCode").ToString) & "') AND (OtherDetail_OptionalAccessories.ODTOA_IsDeleted = N'0')")
        'optdt = ReturnDataTable("SELECT     OtherDetail_OptionalAccessories.ODTOA_kid, Product_Master.Product_Name, Product_Master.Product_Image,Product_Master.Product_AtcoPrice, Product_Master.Product_Code, Product_Master.Product_ModelNo FROM         OtherDetail_OptionalAccessories INNER JOIN                       Product_Master ON OtherDetail_OptionalAccessories.ODTOA_OAccessId = Product_Master.Product_Kid WHERE     (OtherDetail_OptionalAccessories.ODTOA_ProductId = N'" & RemoveLiterals(Session("ProductCode").ToString) & "') AND (OtherDetail_OptionalAccessories.ODTOA_IsDeleted = N'0') AND                        (Product_Master.Product_IsDeleted = N'0')")
        gvAccOpt.DataSource = optdt
        gvAccOpt.DataBind()
        If optdt.Rows.Count = 0 Then
            gvAccOpt.Visible = False
            TdOptionalAccess2.InnerHtml = "<ul>"
            If dtbtnMSG.Rows.Count > 0 Then
                TdOptionalAccess2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("OptionalAccessories").ToString & "</li>"
            Else
                TdOptionalAccess2.InnerHtml += "<li> There are currently no Optional Accessories for this product.</li>"
            End If
            TdOptionalAccess2.InnerHtml += "</ul>"
        End If
        'optdt.Clear()
        'optdt.Dispose()
    End Sub
    Public Sub getUserManual()
        Dim UserManual As String
        UserManual = ReturnValue("Select InstCommManual_UploadedManualFileName from InstallationManual where InstCommManual_ProductId ='" & RemoveLiterals(Session("ProductCode")) & "' and InstCommManual_IsDeleted='0'")
        If UserManual <> "" Then
            'tblMSDS.Visible = True
            TdUserManual1.InnerText = "View User Manual:"
            TdUserManual2.InnerHtml = "<ul>"

            TdUserManual2.InnerHtml += "<a href='" & Page.ResolveUrl("~/Upload Image/Product Image/UploadImages/" & UserManual.ToString.Trim) & "' target='_blank'><img alt='' style='border:none;' src='" & Page.ResolveUrl("~/Images/pdf.jpg") & "' title='" & UserManual.ToString & "'/>" & UserManual.ToString & "</a>"
            '    tblApplication.Rows.Add(New HtmlControls.HtmlTableRow)
            '    tblApplication.Rows(i + 1).Cells.Add(New HtmlControls.HtmlTableCell)
            '    tblApplication.Rows(i + 1).Cells(0).InnerHtml = "<ul><li>" & dt.Rows(i).Item("ProdApp_Application") & "</li>"
            TdUserManual2.InnerHtml += "</ul>"

            'tblApplication.Rows(i + 1).Cells(0).InnerHtml += "</ul>"
        Else
            'tblMSDS.Visible = True
            TdUserManual1.InnerText = "View User Manual:"
            TdUserManual2.InnerHtml += "<ul>"
            If dtbtnMSG.Rows.Count > 0 Then
                TdUserManual2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("UserManual").ToString & "</li>"
            Else
                TdUserManual2.InnerHtml += "<li> There is currently no User Manual for this product.</li>"
            End If
            TdUserManual2.InnerHtml += "</ul>"
        End If
    End Sub
    Public Sub getApplication()
        Try
            Dim dt As DataTable
            dt = ReturnDataTable("Select ProdApp_Application from ProductApplication where ProdApp_ProductId ='" & RemoveLiterals(Session("ProductCode")) & "' and ProdApp_Isdeleted='0'")
            If dt.Rows.Count > 0 Then
                tblApplication.Visible = True
                tdApplication1.InnerText = "Product Applications:"
                tdApplication2.InnerHtml = "<ul>"
                Dim i As Integer
                For i = 0 To dt.Rows.Count - 1
                    tdApplication2.InnerHtml += "<li>" & dt.Rows(i).Item("ProdApp_Application").ToString() & "</li>"
                    '    tblApplication.Rows.Add(New HtmlControls.HtmlTableRow)
                    '    tblApplication.Rows(i + 1).Cells.Add(New HtmlControls.HtmlTableCell)
                    '    tblApplication.Rows(i + 1).Cells(0).InnerHtml = "<ul><li>" & dt.Rows(i).Item("ProdApp_Application") & "</li>"
                Next
                tdApplication2.InnerHtml += "</ul>"

                'tblApplication.Rows(i + 1).Cells(0).InnerHtml += "</ul>"
            Else
                tblApplication.Visible = True
                tdApplication1.InnerText = "Product Applications:"
                tdApplication2.InnerHtml = "<ul>"
                If dtbtnMSG.Rows.Count > 0 Then
                    tdApplication2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("Applications").ToString & "</li>"
                Else
                    tdApplication2.InnerHtml += "<li> There are currently no Applications for this product.</li>"
                End If
                tdApplication2.InnerHtml += "</ul>"
            End If
            dt.Clear()
        Catch ex As Exception

        End Try
    End Sub
    Public Sub getFeature()
        Try
            Dim dt As DataTable
            dt = ReturnDataTable("Select ProdFeatures_Features from ProductFeatures where ProdFeatures_ProductId ='" & RemoveLiterals(Session("ProductCode")) & "' and ProdFeatures_Isdeleted='0'")
            If dt.Rows.Count > 0 Then
                tblFeature.Visible = True
                tdFeature1.InnerText = "Product Features:"
                tdFeature2.InnerHtml = "<ul>"
                Dim i As Integer
                For i = 0 To dt.Rows.Count - 1
                    tdFeature2.InnerHtml += "<li>" & dt.Rows(i).Item("ProdFeatures_Features").ToString() & "</li>"
                    '    tblApplication.Rows.Add(New HtmlControls.HtmlTableRow)
                    '    tblApplication.Rows(i + 1).Cells.Add(New HtmlControls.HtmlTableCell)
                    '    tblApplication.Rows(i + 1).Cells(0).InnerHtml = "<ul><li>" & dt.Rows(i).Item("ProdApp_Application") & "</li>"
                Next
                tdFeature2.InnerHtml += "</ul>"

                'tblApplication.Rows(i + 1).Cells(0).InnerHtml += "</ul>"
            Else
                tblFeature.Visible = True
                tdFeature1.InnerText = "Product Features:"
                tdFeature2.InnerHtml = "<ul>"
                If dtbtnMSG.Rows.Count > 0 Then
                    tdFeature2.InnerHtml += "<li> " & dt.Rows(0).Item("Features").ToString & "</li>"
                Else
                    tdFeature2.InnerHtml += "<li> There are currently no Features for this product.</li>"
                End If
                tdFeature2.InnerHtml += "</ul>"
            End If
            dt.Clear()
        Catch ex As Exception

        End Try
    End Sub
    Public Sub getTechSpeci()
        Try
            Dim dt As DataTable
            dt = ReturnDataTable("SELECT     ProductTechnicalSpecification_Master.TechSpec_Parameter, ProductTechnicalSpecification.TechSpec_value FROM ProductTechnicalSpecification INNER JOIN  ProductTechnicalSpecification_Master ON ProductTechnicalSpecification.TechSpec_ParameterId = ProductTechnicalSpecification_Master.TechSpec_KID WHERE  (ProductTechnicalSpecification.TechSpec_ProductId ='" & RemoveLiterals(Session("ProductCode")) & "' ) AND (ProductTechnicalSpecification.TechSpec_IsDeleted = N'0') AND (ProductTechnicalSpecification_Master.TechSpec_IsDeleted = N'0')")
            'dt = ReturnDataTable("Select TechSpec_Parameter, TechSpec_Value from ProductTechnicalSpecification where TechSpec_ProductId ='" & RemoveLiterals(Session("ProductCode")) & "' and TechSpec_IsDeleted='0'")
            If dt.Rows.Count > 0 Then
                tblTechSpeci.Visible = True
                tdTechSpeci1.InnerText = "Technical Specification :"
                gvtechspec.DataSource = dt
                gvtechspec.DataBind()
                'tdTechSpeci2.InnerHtml = "<ul>"
                'Dim i As Integer
                'For i = 0 To dt.Rows.Count - 1
                '    tdTechSpeci2.InnerHtml += "<li>" & dt.Rows(i).Item("TechSpec_Parameter").ToString() & "&nbsp;&nbsp;-&nbsp;&nbsp;" & dt.Rows(i).Item("TechSpec_Value") & "  </li>"
                '    '    tblApplication.Rows.Add(New HtmlControls.HtmlTableRow)
                '    '    tblApplication.Rows(i + 1).Cells.Add(New HtmlControls.HtmlTableCell)
                '    '    tblApplication.Rows(i + 1).Cells(0).InnerHtml = "<ul><li>" & dt.Rows(i).Item("ProdApp_Application") & "</li>"
                'Next
                'tdTechSpeci2.InnerHtml += "</ul>"

                'tblApplication.Rows(i + 1).Cells(0).InnerHtml += "</ul>"
            Else
                tblTechSpeci.Visible = True
                tdTechSpeci1.InnerText = "Technical Specification :"
                tdTechSpeci2.InnerHtml = "<ul>"
                If dtbtnMSG.Rows.Count > 0 Then
                    tdTechSpeci2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("TechSpecification").ToString & "</li>"
                Else
                    tdTechSpeci2.InnerHtml += "<li> There is currently no Technical Specification for this product.</li>"
                End If
                tdTechSpeci2.InnerHtml += "</ul>"
            End If
            dt.Clear()
        Catch ex As Exception

        End Try
    End Sub
    Public Sub GetSpecialNotes()
        Try
            'Dim dt As DataTable
            'dt = ReturnDataTable("Select ProdSpecInstr_Instruction from ProductSpecialNotesInstruction where ProdSpecInstr_ProductId ='" & RemoveLiterals(Session("ProductCode")) & "' and ProdSpecInstr_IsDeleted='0'")
            'If dt.Rows.Count > 0 Then
            '    tblSpecialNotes.Visible = True
            '    tdSpecialNotes1.InnerText = "Special Notes :"
            '    tdSpecialNotes2.InnerHtml = "<ul>"
            '    Dim i As Integer
            '    For i = 0 To dt.Rows.Count - 1
            '        tdSpecialNotes2.InnerHtml += "<li>" & dt.Rows(i).Item("ProdSpecInstr_Instruction").ToString() & "</li>"
            '        '    tblApplication.Rows.Add(New HtmlControls.HtmlTableRow)
            '        '    tblApplication.Rows(i + 1).Cells.Add(New HtmlControls.HtmlTableCell)
            '        '    tblApplication.Rows(i + 1).Cells(0).InnerHtml = "<ul><li>" & dt.Rows(i).Item("ProdApp_Application") & "</li>"
            '    Next
            '    tdSpecialNotes2.InnerHtml += "</ul>"

            'tblApplication.Rows(i + 1).Cells(0).InnerHtml += "</ul>"

            Dim SpecialNote As String
            SpecialNote = ReturnValue("Select ProdSpecInstr_FileName from ProductSpecialNotesInstruction where ProdSpecInstr_ProductId ='" & RemoveLiterals(Session("ProductCode")) & "' and ProdSpecInstr_IsDeleted='0'")

            If SpecialNote <> "" Then
                tblSpecialNotes.Visible = True
                tdSpecialNotes1.InnerText = "Special Notes :"
                tdSpecialNotes2.InnerHtml = "<ul>"
                tdSpecialNotes2.InnerHtml += "<a href='" & Page.ResolveUrl("~/Upload Image/Product Image/UploadImages/" & SpecialNote) & "' target='_blank'> <img alt='' style='border:none;' src='" & Page.ResolveUrl("~/Images/pdf.jpg") & "' title='" & SpecialNote.ToString & "'/>" & SpecialNote.ToString & "</a>"
                tdSpecialNotes2.InnerHtml += "</ul>"

            Else
                tblSpecialNotes.Visible = True
                tdSpecialNotes1.InnerText = "Special Notes :"
                tdSpecialNotes2.InnerHtml = "<ul>"
                If dtbtnMSG.Rows.Count > 0 Then
                    tdSpecialNotes2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("SpecialInstruction").ToString & "</li>"
                Else
                    tdSpecialNotes2.InnerHtml += "<li> There are currently no Special Notes for this product.</li>"
                End If
                tdSpecialNotes2.InnerHtml += "</ul>"
            End If
            '   dt.Clear()
        Catch ex As Exception

        End Try
    End Sub
    Public Sub getMSDS()
        Dim MSDS As String
        MSDS = ReturnValue("Select MSDS_UploadedDataSheetName from MaterialSafetyDataSheet where MSDS_ProductId ='" & RemoveLiterals(Session("ProductCode")) & "' and MSDS_IsDeleted='0'")
        If MSDS <> "" Then
            tblMSDS.Visible = True
            tdMSDS1.InnerText = "Material Safty DataSheet :"
            tdMSDS2.InnerHtml = "<ul>"
            tdMSDS2.InnerHtml += "<a href='" & Page.ResolveUrl("~/Upload Image/Product Image/UploadImages/" & MSDS) & "' target='_blank'> <img alt='' style='border:none;' src='" & Page.ResolveUrl("~/Images/pdf.jpg") & "' title='" & MSDS.ToString & "'/>" & MSDS.ToString & "</a>"

            '    tblApplication.Rows.Add(New HtmlControls.HtmlTableRow)
            '    tblApplication.Rows(i + 1).Cells.Add(New HtmlControls.HtmlTableCell)
            '    tblApplication.Rows(i + 1).Cells(0).InnerHtml = "<ul><li>" & dt.Rows(i).Item("ProdApp_Application") & "</li>"
            tdMSDS2.InnerHtml += "</ul>"

            'tblApplication.Rows(i + 1).Cells(0).InnerHtml += "</ul>"
        Else
            tblMSDS.Visible = True
            tdMSDS1.InnerText = "Material Safty DataSheet :"
            tdMSDS2.InnerHtml += "<ul>"
            If dtbtnMSG.Rows.Count > 0 Then
                tdMSDS2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("MSDS").ToString & "</li>"
            Else
                tdMSDS2.InnerHtml += "<li> This Product does not require a Material Safty DataSheet.</li>"
            End If
            tdMSDS2.InnerHtml += "</ul>"
        End If

    End Sub
    Public Sub getConsumables()
        Try
            Dim dt As DataTable
            ' Dim str As String = "SELECT  Consumables.c_cname, Consumables.c_cquantity, Unit_Master.Unit_Name FROM Consumables INNER JOIN Unit_Master ON Consumables.c_cunit = Unit_Master.Unit_Kid WHERE (Consumables.c_productid = '" & RemoveLiterals(Session("ProductCode")) & "') and Consumables.c_IsDeleted='0'"
            dt = ReturnDataTable("SELECT  Consumables.c_cname, Consumables.c_cquantity FROM Consumables WHERE (Consumables.c_productid = '" & RemoveLiterals(Session("ProductCode")) & "') and Consumables.c_IsDeleted='0'")
            If dt.Rows.Count > 0 Then
                tblConsumables.Visible = True
                tdConsumables1.InnerText = "Consumables List(Name  -  Value) :"
                tdConsumables2.InnerHtml = "<ul>"
                Dim i As Integer
                For i = 0 To dt.Rows.Count - 1
                    tdConsumables2.InnerHtml += "<li>" & dt.Rows(i).Item("c_cname").ToString() & "&nbsp;&nbsp;-&nbsp;&nbsp;" & dt.Rows(i).Item("c_cquantity").ToString() & "   </li>"    '& "&nbsp;" & dt.Rows(i).Item("Unit_Name").ToString() & "  </li>"
                    '    tblApplication.Rows.Add(New HtmlControls.HtmlTableRow)
                    '    tblApplication.Rows(i + 1).Cells.Add(New HtmlControls.HtmlTableCell)
                    '    tblApplication.Rows(i + 1).Cells(0).InnerHtml = "<ul><li>" & dt.Rows(i).Item("ProdApp_Application") & "</li>"
                Next
                tdConsumables2.InnerHtml += "</ul>"

                'tblApplication.Rows(i + 1).Cells(0).InnerHtml += "</ul>"
            Else
                tblConsumables.Visible = True
                tdConsumables1.InnerText = "Consumables List :"
                tdConsumables2.InnerHtml += "<ul>"
                If dtbtnMSG.Rows.Count > 0 Then
                    tdConsumables2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("Consumables").ToString & "</li>"
                Else
                    tdConsumables2.InnerHtml += "<li> There are currently no Consumables for this product.</li>"
                End If
                tdConsumables2.InnerHtml += "</ul>"
            End If
            dt.Clear()
        Catch ex As Exception

        End Try
    End Sub
    Public Sub getCatalog()
        Dim Catalog As String
        Catalog = ReturnValue("Select Catalog_Upload from Catalog where Catalog_ProductId ='" & RemoveLiterals(Session("ProductCode")) & "'and Catalog_IsDeleted='0'")
        If Catalog <> "" Then
            tblCatalog.Visible = True
            tdCatalog1.InnerText = "View User Catalog: "
            tdCatalog2.InnerHtml = "<ul>"

            tdCatalog2.InnerHtml += " <a href='" & Page.ResolveUrl("~/Upload Image/Product Image/UploadImages/" & Catalog) & "' target='_blank'>  <img alt='' src='" & Page.ResolveUrl("~/images/pdf.jpg") & "' style='border:none;' title'" & Catalog & "'/>" & Catalog.ToString & "</a>"
            '    tblApplication.Rows.Add(New HtmlControls.HtmlTableRow)
            '    tblApplication.Rows(i + 1).Cells.Add(New HtmlControls.HtmlTableCell)
            '    tblApplication.Rows(i + 1).Cells(0).InnerHtml = "<ul><li>" & dt.Rows(i).Item("ProdApp_Application") & "</li>"
            tdCatalog2.InnerHtml += "</ul>"

            'tblApplication.Rows(i + 1).Cells(0).InnerHtml += "</ul>"
        Else
            tblCatalog.Visible = True
            tdCatalog1.InnerText = "View User Catalog: "
            tdCatalog2.InnerHtml += "<ul>"
            If dtbtnMSG.Rows.Count > 0 Then
                tdCatalog2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("Catalog").ToString & "</li>"
            Else
                tdCatalog2.InnerHtml += "<li> There is currently no Catalogue for this product.</li>"
            End If
            tdCatalog2.InnerHtml += "</ul>"
        End If
    End Sub
    Public Sub getStandardApproval()
        Try
            'Dim dt As DataTable
            'dt = ReturnDataTable("SELECT     ProductStandardsMaster.PSM_Name, ProductStandardsMaster.PSM_Logo, ProductStandardsMaster.PSM_Desc,             ProductStandardApproval.ProdStdApproval_FileName FROM         ProductStandardApproval INNER JOIN                       ProductStandardsMaster ON ProductStandardApproval.ProdStdApproval_StandardId = ProductStandardsMaster.PSM_Kid WHERE     (ProductStandardApproval.ProdStdApproval_ProductId ='" & RemoveLiterals(Session("ProductCode")) & "' ) AND (ProductStandardsMaster.PSM_IsDeleted = N'0') AND                        (ProductStandardApproval.ProdStdApproval_IsDeleted = N'0')")
            ''dt = ReturnDataTable("Select ProdStdApproval_StandardName, ProdStdApproval_AgencyApproved, ProdStdApproval_FileName from ProductStandardApproval where ProdStdApproval_ProductId ='" & RemoveLiterals(Session("ProductCode")) & "' and ProdStdApproval_IsDeleted='0'")
            'If dt.Rows.Count > 0 Then
            Dim certificate As String
            certificate = ReturnValue("Select ProdStdApproval_FileName from ProductStandardApproval where ProdStdApproval_ProductId ='" & RemoveLiterals(Session("ProductCode")) & "'and ProdStdApproval_IsDeleted='0'")
            If certificate <> "" Then
                tblStandardApproval.Visible = True
                tdStandardApproval1.InnerText = "Product Certificate:"
                tdStandardApproval2.InnerHtml = "<ul>"
                tdStandardApproval2.InnerHtml += "<a href='" & Page.ResolveUrl("~/Upload Image/Product Image/UploadImages/" & certificate) & "' target='_blank'> <img style='border:none;'  src='" & Page.ResolveUrl("~/images/pdf.jpg") & "' alt='' title='" & certificate & "'/>" & certificate.ToString & "</a>"
                tdStandardApproval2.InnerHtml += "</ul>"

                'tdStandardApproval2.InnerHtml += "<li> Standart Certificate Name :- <span style='font-weight:bold;font-size:larger'> " & dt.Rows(0).Item("PSM_Name").ToString() & " </span>   </li>"
                'tdStandardApproval2.InnerHtml += "<li> Standart Certificate Logo :-  " & dt.Rows(0).Item("PSM_Logo").ToString() & "  </li>"
                'tdStandardApproval2.InnerHtml += "<li> Standart Certificate Discription :- " & dt.Rows(0).Item("PSM_Desc").ToString() & " </b> </li>"
                ''tdStandardApproval2.InnerHtml += "<li> Standart Certificate File :- " & dt.Rows(0).Item("ProdStdApproval_FileName").ToString() & " </li>"

                'If dt.Rows(0).Item("ProdStdApproval_FileName").ToString() <> "" Then
                '    tdStandardApproval2.InnerHtml += "<li> Standart Certificate File :-  <a href='" & Page.ResolveUrl("~/Upload Image/Product Image/UploadImages/" & dt.Rows(0).Item("ProdStdApproval_FileName").ToString()) & "' target='_blank'>" & dt.Rows(0).Item("ProdStdApproval_FileName").ToString() & "</a>   </li>"
                'End If


                'tblApplication.Rows(i + 1).Cells(0).InnerHtml += "</ul>"
            Else
                tblStandardApproval.Visible = True
                tdStandardApproval1.InnerText = "Product Standard Approval:"
                tdStandardApproval2.InnerHtml += "<ul>"
                If dtbtnMSG.Rows.Count > 0 Then
                    tdStandardApproval2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("Certificate").ToString & "</li>"
                Else
                    tdStandardApproval2.InnerHtml += "<li> There are currently no Standards and Certificates for this product.</li>"
                End If
                tdStandardApproval2.InnerHtml += "</ul>"
            End If
            'dt.Clear()
        Catch ex As Exception

        End Try
    End Sub
    Public Sub getInstallationManual()
        Dim InstManual As String
        InstManual = ReturnValue("Select InstCommManual_UploadedManualFileName from InstallationManual where InstCommManual_ProductId ='" & RemoveLiterals(Session("ProductCode")) & "' and InstCommManual_IsDeleted='0'")
        If InstManual <> "" Then
            tblInstallationManual.Visible = True
            tdInstallationManual1.InnerText = "View User Manual:"
            tdInstallationManual2.InnerHtml = "<ul>"

            tdInstallationManual2.InnerHtml += "<li> <a href='" & Page.ResolveUrl("~/Upload Image/Product Image/UploadImages/" & InstManual) & "' target='_blank'>" & InstManual & "</a>   </li>"
            '    tblApplication.Rows.Add(New HtmlControls.HtmlTableRow)
            '    tblApplication.Rows(i + 1).Cells.Add(New HtmlControls.HtmlTableCell)
            '    tblApplication.Rows(i + 1).Cells(0).InnerHtml = "<ul><li>" & dt.Rows(i).Item("ProdApp_Application") & "</li>"
            tdInstallationManual2.InnerHtml += "</ul>"

            'tblApplication.Rows(i + 1).Cells(0).InnerHtml += "</ul>"
        Else
            tblInstallationManual.Visible = True
            tdInstallationManual1.InnerText = "View User Manual:"
            tdInstallationManual2.InnerHtml += "<ul>"
            If dtbtnMSG.Rows.Count > 0 Then
                tdInstallationManual2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("InstallationCommissioning").ToString & " </li>"
            Else
                tdInstallationManual2.InnerHtml += "<li> This Product does not contain any Installation and Commissioning Details.</li>"
            End If
            tdInstallationManual2.InnerHtml += "</ul>"
        End If
    End Sub
    Public Sub getGarantyWaranty()
        Try
            Dim dt As DataTable
            ' Dim i As Integer
            dt = ReturnDataTable("SELECT     Product_GuarantyWarrantydetails.*  FROM Product_GuarantyWarrantydetails WHERE  gwd_ProductId = '" & RemoveLiterals(Session("ProductCode").ToString) & "' AND gwd_IsDeleted = '0'")


            If dt.Rows.Count > 0 Then
                TdGarantyWaranty2.InnerHtml = "<br/>"
                If (dt.Rows(0).Item("gwd_Type").ToString = "Guaranty") Then
                    TdGarantyWaranty2.InnerHtml += "<span style='font-weight:bold;font-size:10pt;color:maroon;'>Guaranty</span>"
                    TdGarantyWaranty2.InnerHtml += "<ul>"
                    TdGarantyWaranty2.InnerHtml += "<li>Guaranty Period :&nbsp; <span style='font-weight:bold;'>" & dt.Rows(0).Item("gwd_pguarentee1").ToString & "  " & ReturnValue("Select Unit_Name from Unit_Master where Unit_Kid='" & dt.Rows(0).Item("gwd_pguarentee2").ToString & "'") & "</span>"
                    If dt.Rows(0).Item("gwd_FileName").ToString <> "" Then
                        TdGarantyWaranty2.InnerHtml += "<li>FileName :" & "<a href='" & Page.ResolveUrl("~/Upload Image/Product Image/UploadImages/" & dt.Rows(0).Item("gwd_FileName").ToString) & "' target='_blank'> <img alt='' style='border:none;' src='" & Page.ResolveUrl("~/Images/pdf.jpg") & "' title='" & dt.Rows(0).Item("gwd_FileName").ToString & "'/>" & dt.Rows(0).Item("gwd_FileName").ToString & "</a>"
                    Else
                        TdGarantyWaranty2.InnerHtml += "<li>FileName : <span style='font-weight:bold;'>File NOT Uploaded.</span>"
                    End If

                    TdGarantyWaranty2.InnerHtml += "</ul>"
                  
                Else
                    TdGarantyWaranty2.InnerHtml += "<span style='font-weight:bold;font-size:10pt;color:maroon;'>Warranty</span>"
                    TdGarantyWaranty2.InnerHtml += "<ul>"
                    TdGarantyWaranty2.InnerHtml += "<li>Warranty Period :&nbsp; <span style='font-weight:bold;'>" & dt.Rows(0).Item("gwd_pwarranty1").ToString & "  " & ReturnValue("Select Unit_Name from Unit_Master where Unit_Kid='" & dt.Rows(0).Item("gwd_pwarranty2").ToString & "'") & "</span>"
                    If dt.Rows(0).Item("gwd_FileName").ToString <> "" Then
                        TdGarantyWaranty2.InnerHtml += "<li>FileName :" & "<a href='" & Page.ResolveUrl("~/Upload Image/Product Image/UploadImages/" & dt.Rows(0).Item("gwd_FileName").ToString) & "' target='_blank'> <img alt='' style='border:none;' src='" & Page.ResolveUrl("~/Images/pdf.jpg") & "' title='" & dt.Rows(0).Item("gwd_FileName").ToString & "'/>" & dt.Rows(0).Item("gwd_FileName").ToString & "</a>"
                    Else
                        TdGarantyWaranty2.InnerHtml += "<li>FileName : <span style='font-weight:bold;'>File NOT Uploaded.</span>"
                    End If
                    TdGarantyWaranty2.InnerHtml += "</ul>"

                End If

            Else
                TdGarantyWaranty2.InnerHtml += "<ul>"
                If dtbtnMSG.Rows.Count > 0 Then
                    TdGarantyWaranty2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("GuarantyWarranty").ToString & " </li>"
                Else
                    TdGarantyWaranty2.InnerHtml += "<li> Guaranty / Warranty details are not provided for this product.</li>"
                End If
                TdGarantyWaranty2.InnerHtml += "</ul>"
            End If

        Catch ex As Exception

        End Try
    End Sub
    Public Sub getPackaging()
        Try
            Dim dt As DataTable
            dt = ReturnDataTable("Select ProdPackaging_PackingType, ProdPackaging_Material, ProdPackaging_ProdDetails, ProdPackaging_IsFragile, ProdPackaging_IsWoodContain, ProdPackaging_IsEnvirnomentalFriendly,ProdPackaging_FileName from ProductPackaging where ProdPackaging_ProductId='" & RemoveLiterals(Session("ProductCode")) & "' and ProdPackaging_IsDeleted='0'")
            gvPackaging.DataSource = dt
            gvPackaging.DataBind()
            If dt.Rows.Count > 0 Then
                tblPackaging.Visible = True
                tdPackaging1.InnerText = "Product Packaging Details:"
                gvPackaging.Visible = True
                'By Pankaj Mishra

                'gvPackaging.DataSource = dt
                'gvPackaging.DataBind()

                Dim i As Integer
                For i = 0 To gvPackaging.Rows.Count - 1
                    If (gvPackaging.Rows(i).Cells(2).Text = "Y") Then
                        gvPackaging.Rows(i).Cells(2).Text = "YES"
                    ElseIf gvPackaging.Rows(i).Cells(2).Text = "N" Then
                        gvPackaging.Rows(i).Cells(2).Text = "NO"
                    End If

                    If (gvPackaging.Rows(i).Cells(3).Text = "Y") Then
                        gvPackaging.Rows(i).Cells(3).Text = "YES"
                    ElseIf gvPackaging.Rows(i).Cells(3).Text = "N" Then
                        gvPackaging.Rows(i).Cells(3).Text = "NO"
                    End If

                    If (gvPackaging.Rows(i).Cells(4).Text = "Y") Then
                        gvPackaging.Rows(i).Cells(4).Text = "YES"
                    ElseIf gvPackaging.Rows(i).Cells(4).Text = "N" Then
                        gvPackaging.Rows(i).Cells(4).Text = "NO"
                    End If

                Next

            Else
                tblPackaging.Visible = True
                tdPackaging1.InnerText = "Product Packaging Details:"
                gvPackaging.Visible = False
                tdPackaging2.InnerHtml = "<ul>"
                If dtbtnMSG.Rows.Count > 0 Then
                    tdPackaging2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("Packaging").ToString & "</li>"
                Else
                    tdPackaging2.InnerHtml += "<li> This Product does not have any Packaging Details.</li>"
                End If
                tdPackaging2.InnerHtml += "</ul>"
            End If

            dt.Clear()
        Catch ex As Exception

        End Try
    End Sub
    Public Sub getInstCommission()
        Try


            Dim dt As DataTable
            dt = ReturnDataTable("Select InstallationComm_IsRequired, InstallationComm_IsChargeable, InstallationComm_Amount, InstallationComm_IsMaintenanceTraining, InstallationComm_IsAMCAvailable,InstallationComm_FileName from ProductInstallationCommissioning where InstallationComm_ProductId='" & RemoveLiterals(Session("ProductCode")) & "' and InstallationComm_IsDeleted='0'")

            If dt.Rows.Count > 0 Then
                If dt.Rows(0).Item("InstallationComm_IsRequired").ToString = "N" Then
                    TdInstComm2.InnerHtml = "<ul>"
                    TdInstComm2.InnerHtml += "<li>Required ? &nbsp; <span style='font-weight:bold'> NO </span></li>"
                ElseIf dt.Rows(0).Item("InstallationComm_IsRequired").ToString = "Y" Then
                    TdInstComm2.InnerHtml = "<ul>"
                    TdInstComm2.InnerHtml += "<li>Required ? &nbsp; <span style='font-weight:bold'> YES </span></li>"
                    If dt.Rows(0).Item("InstallationComm_IsChargeable").ToString = "Y" Then
                        TdInstComm2.InnerHtml += "<li>Chargeable ? &nbsp; <span style='font-weight:bold'> YES </span></li>"
                        If dt.Rows(0).Item("InstallationComm_Amount").ToString <> "" Then
                            TdInstComm2.InnerHtml += "<li> Amount :- <span style='font-weight:bold'> Rs.  " & dt.Rows(0).Item("InstallationComm_Amount").ToString & " </span></li>"
                        End If
                    ElseIf dt.Rows(0).Item("InstallationComm_IsChargeable").ToString = "N" Then
                        TdInstComm2.InnerHtml += "<li>Chargeable ? &nbsp; <span style='font-weight:bold'> NO </span></li>"
                    End If

                    If dt.Rows(0).Item("InstallationComm_FileName").ToString <> "" Then
                        TdInstComm2.InnerHtml += "<li>FileName :" & "<a href='" & Page.ResolveUrl("~/Upload Image/Product Image/UploadImages/" & dt.Rows(0).Item("InstallationComm_FileName").ToString) & "' target='_blank'> <img alt='' style='border:none;' src='" & Page.ResolveUrl("~/Images/pdf.jpg") & "' title='" & dt.Rows(0).Item("InstallationComm_FileName").ToString & "'/>" & dt.Rows(0).Item("InstallationComm_FileName").ToString & "</a>"
                    Else
                        TdInstComm2.InnerHtml += "<li> File Name: File NOT Uploaded."
                    End If
                End If
            Else
                tblInstComm.Visible = True
                TdInstComm1.InnerText = "Product Installation Commissioning Details :-"
                TdInstComm2.InnerHtml += "<ul>"
                If dtbtnMSG.Rows.Count > 0 Then
                    TdInstComm2.InnerHtml += "<li> " & dtbtnMSG.Rows(0).Item("InstallationCommissioning").ToString & " </li>"
                Else
                    TdInstComm2.InnerHtml += "<li> This Product does not contain any Installation and Commissioning Details.</li>"
                End If
                TdInstComm2.InnerHtml += "</ul>"

            End If


            dt.Clear()
        Catch ex As Exception

        End Try
    End Sub

    Protected Sub ImgApplication_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        tblApplication.Style.Add("display", "inline")
        ImgApplication.Focus()
    End Sub

   
End Class
