Imports System.Data
Imports System.Data.SqlClient
Partial Class Admin_suppwiseproductinforeport
    Inherits System.Web.UI.Page
    Dim str1 As String
    Dim supid As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Session("AdminID") Is Nothing Then
            Response.Redirect("AdminLogin.aspx?sesn=expire")
            Exit Sub
        End If

        str1 = Request.QueryString.Get("Kid")
        supid = DecodeURL(str1)
        '' str1 = "0000|{_"
        Dim cn As New System.Data.SqlClient.SqlConnection(ConfigurationManager.AppSettings("ConnectionString"))
        Dim objAdapter As SqlDataAdapter
        Dim ObjDS As DataSet
        Dim dt As DataTable
        cn.Open()


        If Not Page.IsPostBack Then


            dt = ReturnDataTable("Select Product_Kid,Product_Name FROM Product_Master WHERE Product_Master.Product_SupplierId ='" & supid & "' and Product_Master.Product_IsDeleted='0' order by product_code")
            ddlproduct.DataSource = dt
            ddlproduct.DataTextField = "Product_Name"
            ddlproduct.DataValueField = "Product_Kid"
            ddlproduct.DataBind()

            Try
                '     objAdapter = New SqlDataAdapter("SELECT Supplier_Master.Supplier_Name, Supplier_Master.Supplier_Address, Supplier_Master.Supplier_PinCode, Supplier_Master.Supplier_TelNumber, City_Master.City_Name, Country_Master.Country_Name, State_Master.State_Name FROM City_Master INNER JOIN Supplier_Master ON City_Master.City_Kid = Supplier_Master.Supplier_CityId INNER JOIN State_Master ON City_Master.City_StateId = State_Master.State_Kid INNER JOIN Country_Master ON State_Master.State_CountryId = Country_Master.Country_Kid where Supplier_Master.Supplier_Kid='" & str & "'", cn)
                objAdapter = New SqlDataAdapter("SELECT Supplier_Master.Supplier_Name,Supplier_Master.Supplier_Address, Supplier_Master.Supplier_PinCode, Supplier_Master.Supplier_TelNumber,City_Master.City_Name, State_Master.State_Name, Country_Master.Country_Name FROM Supplier_Master LEFT OUTER JOIN City_Master ON Supplier_Master.Supplier_CityId = City_Master.City_Kid LEFT OUTER JOIN Country_Master INNER JOIN State_Master ON Country_Master.Country_Kid = State_Master.State_CountryId ON City_Master.City_StateId = State_Master.State_Kid WHERE Supplier_Master.Supplier_Kid = '" & supid & "'", cn)
                objAdapter.SelectCommand.CommandType = CommandType.Text
                ObjDS = New DataSet
                objAdapter.Fill(ObjDS)
                If (ObjDS.Tables(0).Rows.Count = 0) Then
                    tddetail.Visible = False
                    tdmsg.InnerHtml = "No Supplier Details Found"
                    Exit Sub

                End If
                tdmsg.InnerHtml = ""
                tddetail.Visible = True
                If (ObjDS.Tables(0).Rows(0).Item("Supplier_Address").ToString = "") Then
                    Label1.Text = ""
                End If

                If ObjDS.Tables(0).Rows(0).Item("Supplier_TelNumber").ToString = "&nbsp;" Then
                    ObjDS.Tables(0).Rows(0).Item("Supplier_TelNumber") = "N/A"
                End If
                lblname.Text = ObjDS.Tables(0).Rows(0).Item("Supplier_Name").ToString
                Label1.Text = ObjDS.Tables(0).Rows(0).Item("Supplier_Address").ToString & ",  " & ObjDS.Tables(0).Rows(0).Item("City_Name").ToString & ",  <br/> " & ObjDS.Tables(0).Rows(0).Item("State_Name").ToString & ", " & ObjDS.Tables(0).Rows(0).Item("Country_Name").ToString & " - " & ObjDS.Tables(0).Rows(0).Item("Supplier_PinCode").ToString & "<br/> Ph.- " & ObjDS.Tables(0).Rows(0).Item("Supplier_TelNumber").ToString

                If dt.Rows.Count = 0 Then
                    lblError.Text = "No Product Available"
                    ddlproduct.Visible = False
                    lblproduct.Visible = False
                    lbldescription.Visible = False
                    Exit Sub
                Else
                    ddlproduct.Visible = True
                    lblproduct.Visible = True
                    lbldescription.Visible = True
                    lblError.Text = ""
                End If
                fillgridproductinfo()

            Catch ex As Exception
                ' Throw ex

            Finally
                cn.Close()
                cn.Dispose()
            End Try
        End If
    End Sub
    Public Sub fillgridproductinfo()
     
        Dim ds As DataSet
        ds = SupplierProductInformation(supid, ddlproduct.SelectedItem.Value)
        DetailsView1.DataSource = ds
        DetailsView1.DataBind()

        ''dim dt as DataTable
        ''  dt = ReturnDataTable("SELECT DISTINCT Product_Master.Product_Kid, Product_Master.Product_Name, Product_Master.Product_ModelNo, Product_Master.Product_Image, Product_Master.Product_MarketPrice, Product_Master.Product_MinOrderQty, Product_Master.Product_ShippingQty, Product_Master.Product_Dimension, Product_Master.Product_Weight, Product_Master.Product_DeliveryPeriod, Product_Master.Product_Description, ProductVat.ProductVat_ITCHSCode, ProductVat.ProductVat_BTNNo, ProductVat.ProductVat_ExciseDuty, ProductVat.ProductVat_EduCess, ProductVat.ProductVat_HigherEduCess, ProductVat.ProductVat_ExciseDateRemark, ProductVat.ProductVat_VAT, ProductVat.ProductVat_CST, ProductVat.ProductVat_CSTAgainstC, ProductVat.ProductVat_SalesTaxRemark, Product_Master.Product_SupplierId, Product_Master.Product_IsWear_Tear, Brand_Master.Brand_Kid, Brand_Master.Brand_Name,ProductTechnicalSpecification.TechSpec_ProductId AS TechSpecId, Product_GuarantyWarrantydetails.gwd_ProductId AS Guaranty_Warranty, InstallationManual.InstCommManual_ProductId AS Inst_Manual, ProductApplication.ProdApp_ProductId AS Prod_Application, ProductSpecialNotesInstruction.ProdSpecInstr_ProductId AS SpecialNote, MaterialSafetyDataSheet.MSDS_ProductId AS MaterialSafety, ProductVat.ProductVat_ProductId AS ProductVAT, ProductPackaging.ProdPackaging_ProductId AS Prod_Packaging, ProductInstallationCommissioning.InstallationComm_ProductId AS InstallationComissioning, OtherDetail_IncludedAccessories.ODTIA_ProductId AS IncludedAccessories, Consumables.c_productid AS Consumables, Catalog.Catalog_productid AS Catalogue, OtherDetail_OptionalAccessories.ODTOA_ProductId AS OptionalAccessories, OtherDetail_SpareParts.ODTSP_ProductId AS SpareParts, ProductFeatures.ProdFeatures_ProductId AS Features, ProductStandardApproval.ProdStdApproval_ProductId AS StandardApproval FROM Product_Master LEFT OUTER JOIN Brand_Master ON Product_Master.Product_BrandId = Brand_Master.Brand_Kid LEFT OUTER JOIN Catalog ON Product_Master.Product_Kid = Catalog.Catalog_productid LEFT OUTER JOIN Consumables ON Product_Master.Product_Kid = Consumables.c_productid LEFT OUTER JOIN ProductInstallationCommissioning ON Product_Master.Product_Kid = ProductInstallationCommissioning.InstallationComm_ProductId LEFT OUTER JOIN ProductPackaging ON Product_Master.Product_Kid = ProductPackaging.ProdPackaging_ProductId LEFT OUTER JOIN Product_GuarantyWarrantydetails ON Product_Master.Product_Kid = Product_GuarantyWarrantydetails.gwd_ProductId LEFT OUTER JOIN InstallationManual ON Product_Master.Product_Kid = InstallationManual.InstCommManual_ProductId LEFT OUTER JOIN ProductStandardApproval ON Product_Master.Product_Kid = ProductStandardApproval.ProdStdApproval_ProductId LEFT OUTER JOIN OtherDetail_SpareParts ON Product_Master.Product_Kid = OtherDetail_SpareParts.ODTSP_ProductId LEFT OUTER JOIN OtherDetail_IncludedAccessories ON Product_Master.Product_Kid = OtherDetail_IncludedAccessories.ODTIA_ProductId LEFT OUTER JOIN OtherDetail_OptionalAccessories ON Product_Master.Product_Kid = OtherDetail_OptionalAccessories.ODTOA_ProductId LEFT OUTER JOIN MaterialSafetyDataSheet ON Product_Master.Product_Kid = MaterialSafetyDataSheet.MSDS_ProductId LEFT OUTER JOIN ProductSpecialNotesInstruction ON Product_Master.Product_Kid = ProductSpecialNotesInstruction.ProdSpecInstr_ProductId LEFT OUTER JOIN  ProductTechnicalSpecification ON Product_Master.Product_Kid = ProductTechnicalSpecification.TechSpec_ProductId LEFT OUTER JOIN  ProductFeatures ON Product_Master.Product_Kid = ProductFeatures.ProdFeatures_ProductId LEFT OUTER JOIN ProductApplication ON Product_Master.Product_Kid = ProductApplication.ProdApp_ProductId LEFT OUTER JOIN ProductVat ON Product_Master.Product_Kid = ProductVat.ProductVat_ProductId AND Product_Master.Product_Kid = ProductVat.ProductVat_Kid WHERE Product_Master.Product_SupplierId ='" & str1 & "'AND Product_Master.Product_IsDeleted = '0' AND Product_Master.Product_Kid = '" & ddlproduct.SelectedItem.Value & "'")
        'dtProductInfo.DataSource = ds
        'dtProductInfo.DataBind()


        ' ''image & description
        ' ''    imgproduct.ImageUrl = "../Upload Image/Product Image/UploadImages/" + ds.Tables(0).Rows(0).Item("Product_Image").ToString
        ' ''  lbldesc.Text = ds.Tables(0).Rows(0).Item("Product_Description").ToString

        ' ''product model no
        ''If ds.Tables(0).Rows(0).Item("Product_ModelNo").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(1).FindControl("Imgmodelno"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(1).FindControl("Imgmodelno"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''product marketprice
        ''If ds.Tables(0).Rows(0).Item("Product_MarketPrice").ToString <> "" Then
        ''    If ds.Tables(0).Rows(0).Item("Product_MarketPrice").ToString = "0.0" Or ds.Tables(0).Rows(0).Item("Product_MarketPrice").ToString = "0" Then
        ''        CType(dtProductInfo.Rows.Item(2).FindControl("imgprice"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''    Else
        ''        CType(dtProductInfo.Rows.Item(2).FindControl("imgprice"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''    End If
        ''Else
        ''    CType(dtProductInfo.Rows.Item(2).FindControl("imgprice"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''product minimum order quantity
        ''If ds.Tables(0).Rows(0).Item("Product_MinOrderQty").ToString <> "" Or ds.Tables(0).Rows(0).Item("Product_MinOrderQty").ToString = "0.0" Or ds.Tables(0).Rows(0).Item("Product_MinOrderQty").ToString = "0" Then
        ''    CType(dtProductInfo.Rows.Item(3).FindControl("imgorderqty"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(3).FindControl("imgorderqty"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''product shipping quantity
        ''If ds.Tables(0).Rows(0).Item("Product_ShippingQty").ToString <> "" Then
        ''    If ds.Tables(0).Rows(0).Item("Product_ShippingQty").ToString = "0.0" Or ds.Tables(0).Rows(0).Item("Product_ShippingQty").ToString = "0" Then
        ''        CType(dtProductInfo.Rows.Item(4).FindControl("imgshipqty"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''    Else
        ''        CType(dtProductInfo.Rows.Item(4).FindControl("imgshipqty"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''    End If
        ''Else
        ''    CType(dtProductInfo.Rows.Item(4).FindControl("imgshipqty"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''product dimension
        ''If ds.Tables(0).Rows(0).Item("Product_Dimension").ToString <> "" Then
        ''    If ds.Tables(0).Rows(0).Item("Product_Dimension").ToString = "0.0" Or ds.Tables(0).Rows(0).Item("Product_Dimension").ToString = "0X0X0" Then
        ''        CType(dtProductInfo.Rows.Item(5).FindControl("imgdimension"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''    Else
        ''        CType(dtProductInfo.Rows.Item(5).FindControl("imgdimension"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''    End If
        ''Else
        ''    CType(dtProductInfo.Rows.Item(5).FindControl("imgdimension"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''product weight
        ''If ds.Tables(0).Rows(0).Item("Product_Weight").ToString <> "" Then
        ''    If ds.Tables(0).Rows(0).Item("Product_Weight").ToString = "0" Then
        ''        CType(dtProductInfo.Rows.Item(6).FindControl("imgweight"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''    Else
        ''        CType(dtProductInfo.Rows.Item(6).FindControl("imgweight"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''    End If
        ''Else
        ''    CType(dtProductInfo.Rows.Item(6).FindControl("imgweight"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''product delivery period time
        ''If ds.Tables(0).Rows(0).Item("Product_DeliveryPeriod").ToString <> "" Then
        ''    If ds.Tables(0).Rows(0).Item("Product_DeliveryPeriod").ToString = "0" Then
        ''        CType(dtProductInfo.Rows.Item(7).FindControl("imgdelivery"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''    Else
        ''        CType(dtProductInfo.Rows.Item(7).FindControl("imgdelivery"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''    End If
        ''Else
        ''    CType(dtProductInfo.Rows.Item(7).FindControl("imgdelivery"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''product's ITCHS Code
        ''If ds.Tables(0).Rows(0).Item("ProductVat_ITCHSCode").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(8).FindControl("imgitchscode"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(8).FindControl("imgitchscode"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''product's BTN No
        ''If ds.Tables(0).Rows(0).Item("ProductVat_BTNNo").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(9).FindControl("imgbtnno"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(9).FindControl("imgbtnno"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''Product ExciseDuty
        ''If ds.Tables(0).Rows(0).Item("ProductVat_ExciseDuty").ToString <> "" Then
        ''    If ds.Tables(0).Rows(0).Item("ProductVat_ExciseDuty").ToString = "0.0" Or ds.Tables(0).Rows(0).Item("ProductVat_ExciseDuty").ToString = "0" Then
        ''        CType(dtProductInfo.Rows.Item(10).FindControl("imgexciseduty"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''    Else
        ''        CType(dtProductInfo.Rows.Item(10).FindControl("imgexciseduty"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''    End If
        ''Else
        ''    CType(dtProductInfo.Rows.Item(10).FindControl("imgexciseduty"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''Product EducationCess
        ''If ds.Tables(0).Rows(0).Item("ProductVat_EduCess").ToString <> "" Then
        ''    If ds.Tables(0).Rows(0).Item("ProductVat_EduCess").ToString = "0.0" Or ds.Tables(0).Rows(0).Item("ProductVat_EduCess").ToString = "0" Then
        ''        CType(dtProductInfo.Rows.Item(11).FindControl("imgeducess"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''    Else
        ''        CType(dtProductInfo.Rows.Item(11).FindControl("imgeducess"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''    End If
        ''Else
        ''    CType(dtProductInfo.Rows.Item(11).FindControl("imgeducess"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''Product HigherEducationCess
        ''If ds.Tables(0).Rows(0).Item("ProductVat_HigherEduCess").ToString <> "" Then
        ''    If ds.Tables(0).Rows(0).Item("ProductVat_HigherEduCess").ToString = "0.0" Or ds.Tables(0).Rows(0).Item("ProductVat_HigherEduCess").ToString = "0" Then
        ''        CType(dtProductInfo.Rows.Item(12).FindControl("imghighereducess"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''    Else
        ''        CType(dtProductInfo.Rows.Item(12).FindControl("imghighereducess"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''    End If
        ''Else
        ''    CType(dtProductInfo.Rows.Item(12).FindControl("imghighereducess"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''Product ExciseDateRemark
        ''If ds.Tables(0).Rows(0).Item("ProductVat_ExciseDateRemark").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(13).FindControl("imgexcisedateremark"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(13).FindControl("imgexcisedateremark"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''product VAT
        ''If ds.Tables(0).Rows(0).Item("ProductVat_VAT").ToString <> "" Then
        ''    If ds.Tables(0).Rows(0).Item("ProductVat_VAT").ToString = "0.0" Or ds.Tables(0).Rows(0).Item("ProductVat_VAT").ToString = "0" Then
        ''        CType(dtProductInfo.Rows.Item(14).FindControl("imgvat"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''    Else
        ''        CType(dtProductInfo.Rows.Item(14).FindControl("imgvat"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''    End If
        ''Else
        ''    CType(dtProductInfo.Rows.Item(14).FindControl("imgvat"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''product CST
        ''If ds.Tables(0).Rows(0).Item("ProductVat_CST").ToString <> "" Then
        ''    If ds.Tables(0).Rows(0).Item("ProductVat_CST").ToString = "0.0" Or ds.Tables(0).Rows(0).Item("ProductVat_CST").ToString = "0" Then
        ''        CType(dtProductInfo.Rows.Item(15).FindControl("imgcst"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''    Else
        ''        CType(dtProductInfo.Rows.Item(15).FindControl("imgcst"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''    End If
        ''Else
        ''    CType(dtProductInfo.Rows.Item(15).FindControl("imgcst"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''product CST Against C Form
        ''If ds.Tables(0).Rows(0).Item("ProductVat_CSTAgainstC").ToString <> "" Then
        ''    If ds.Tables(0).Rows(0).Item("ProductVat_CSTAgainstC").ToString = "0.0" Or ds.Tables(0).Rows(0).Item("ProductVat_CSTAgainstC").ToString = "0" Then
        ''        CType(dtProductInfo.Rows.Item(15).FindControl("imgcstcform"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''    Else
        ''        CType(dtProductInfo.Rows.Item(15).FindControl("imgcstcform"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''    End If
        ''Else
        ''    CType(dtProductInfo.Rows.Item(15).FindControl("imgcstcform"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ' ''product SalesTax Remark
        ''If ds.Tables(0).Rows(0).Item("ProductVat_SalesTaxRemark").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(16).FindControl("imgsalestax"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(16).FindControl("imgsalestax"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If


        ' ''product's Brand Name
        ''If ds.Tables(0).Rows(0).Item("Brand_Name").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(17).FindControl("imgbrandname"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(17).FindControl("imgbrandname"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If


        ''If ds.Tables(0).Rows(0).Item("Application_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(18).FindControl("imgapplication"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(18).FindControl("imgapplication"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ''If ds.Tables(0).Rows(0).Item("Features_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(19).FindControl("imgfeatures"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(19).FindControl("imgfeatures"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ''If ds.Tables(0).Rows(0).Item("TechSpec_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(20).FindControl("imgtechspec"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(20).FindControl("imgtechspec"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ''If ds.Tables(0).Rows(0).Item("SpecialNote_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(21).FindControl("imgspecialnote"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(21).FindControl("imgspecialnote"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ''If ds.Tables(0).Rows(0).Item("MaterialSafety_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(22).FindControl("imgmsds"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(22).FindControl("imgmsds"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If


        ''If ds.Tables(0).Rows(0).Item("OptionalAccessories_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(23).FindControl("imgoptional"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(23).FindControl("imgoptional"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If



        ' ''product Iswear & Tear
        ''If ds.Tables(0).Rows(0).Item("Product_IsWear_Tear").ToString <> "" Then
        ''    If ds.Tables(0).Rows(0).Item("Product_IsWear_Tear").ToString = "N" Then
        ''        CType(dtProductInfo.Rows.Item(24).FindControl("imgweartear"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''    Else
        ''        CType(dtProductInfo.Rows.Item(24).FindControl("imgweartear"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''    End If
        ''Else
        ''    CType(dtProductInfo.Rows.Item(24).FindControl("imgweartear"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If


        ''If ds.Tables(0).Rows(0).Item("Consumables_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(25).FindControl("imgconsumable"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(25).FindControl("imgconsumable"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ''If ds.Tables(0).Rows(0).Item("Catalogue_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(26).FindControl("imgcatalogue"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(26).FindControl("imgcatalogue"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ''If ds.Tables(0).Rows(0).Item("StandardApproval_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(27).FindControl("imgstdapproval"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(27).FindControl("imgstdapproval"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")
        ''End If

        ''If ds.Tables(0).Rows(0).Item("UserManual_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(28).FindControl("imgusermanual"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(28).FindControl("imgusermanual"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")

        ''End If

        ''If ds.Tables(0).Rows(0).Item("Guaranty_Warranty_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(29).FindControl("imgguaranty"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(29).FindControl("imgguaranty"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")

        ''End If

        ''If ds.Tables(0).Rows(0).Item("Prod_Packaging_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(30).FindControl("imgpackaging"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(30).FindControl("imgpackaging"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")

        ''End If
        ''If ds.Tables(0).Rows(0).Item("IncludedAccessories_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(31).FindControl("imgincluded"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(31).FindControl("imgincluded"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")

        ''End If

        ''If ds.Tables(0).Rows(0).Item("SpareParts_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(32).FindControl("imgsparepart"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(32).FindControl("imgsparepart"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")

        ''End If

        ''If ds.Tables(0).Rows(0).Item("InstallationComissioning_Available").ToString <> "" Then
        ''    CType(dtProductInfo.Rows.Item(33).FindControl("imginstcomm"), Image).ImageUrl = ResolveUrl("~/Images/ok.jpg")
        ''Else
        ''    CType(dtProductInfo.Rows.Item(33).FindControl("imginstcomm"), Image).ImageUrl = ResolveUrl("~/Images/remove.gif")

        ''End If

    End Sub

  
    Protected Sub ddlproduct_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlproduct.SelectedIndexChanged
        fillgridproductinfo()
    End Sub

    Public Function SupplierProductInformation(ByVal suppid As String, ByVal prodid As String) As DataSet
        Dim cn As New System.Data.SqlClient.SqlConnection(ConfigurationManager.AppSettings("ConnectionString"))
        Dim objAdapter As SqlDataAdapter
        Dim ObjDS As DataSet

        cn.Open()

        Try
            objAdapter = New SqlDataAdapter("SupplierwiseProductInfo_Proc", cn)
            objAdapter.SelectCommand.CommandType = CommandType.StoredProcedure

            objAdapter.SelectCommand.Parameters.Add(New SqlParameter("@Product_SupplierId", SqlDbType.NVarChar, 50))
            objAdapter.SelectCommand.Parameters.Add(New SqlParameter("@Product_KId", SqlDbType.NVarChar, 10))

            objAdapter.SelectCommand.Parameters("@Product_SupplierId").Value = suppid
            objAdapter.SelectCommand.Parameters("@Product_KId").Value = prodid
            ObjDS = New DataSet
            objAdapter.Fill(ObjDS)
            Return ObjDS

        Catch ex As Exception
            Throw ex
        Finally
            cn.Close()
            cn.Dispose()
        End Try

    End Function

   
    Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles DetailsView1.DataBound

        'image & description
        imgproduct.ImageUrl = "../Upload Image/Product Image/UploadImages/" + DetailsView1.Rows.Item(3).Cells(1).Text.ToString
        lbldesc.Text = DetailsView1.Rows.Item(10).Cells(1).Text.ToString

        Dim i As Integer
        For i = 0 To DetailsView1.Rows.Count - 1
            If (DetailsView1.Rows.Item(i).Cells(1).Text.ToString) = "&nbsp;" Or (DetailsView1.Rows.Item(i).Cells(1).Text.ToString) = "0" Or (DetailsView1.Rows.Item(i).Cells(1).Text.ToString) = "0.0" Or (DetailsView1.Rows.Item(i).Cells(1).Text.ToString) = "0X0X0" Or (DetailsView1.Rows.Item(i).Cells(1).Text.ToString) = "" Or (DetailsView1.Rows.Item(i).Cells(1).Text.ToString) = "N" Then
                DetailsView1.Rows.Item(i).Cells(1).Text = "<img alt='' src='" & Page.ResolveUrl("~/Images/close_button1.jpg") & "'/>"
            Else
                DetailsView1.Rows.Item(i).Cells(1).Text = "<img alt='' src='" & Page.ResolveUrl("~/Images/ok_1.jpg") & "'/>"
            End If
        Next

        DetailsView1.Rows.Item(0).Visible = False       'product Kid
        DetailsView1.Rows.Item(1).Visible = False       'product name
        DetailsView1.Rows.Item(3).Visible = False       'product image
        DetailsView1.Rows.Item(10).Visible = False      'product description
        DetailsView1.Rows.Item(21).Visible = False      'Supplier ID
        DetailsView1.Rows.Item(22).Visible = False      'Brand ID

    End Sub

  
End Class
