Imports EDSL.Entities
Imports EDSL.DAL
Public Partial Class CaseStudyArticleControl
Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim objMainCaseStudyitem As entMainCaseStudy = GetItem()
        Dim breadcrumblabel As String
        Dim breadcrumbNavigate As String
        Dim breadTitle As String
        Dim objMainCategory As New dbMainCategory
        Dim category As entmainCategory = objMainCategory.GetItem(Convert.ToInt32(Request.QueryString("cst")))
        breadcrumblabel = category.CategoryName & " Case Studies"
        Dim func As New miscFunctions

        breadcrumbNavigate = "~/casestudy/CaseStudies.html?cst=" & Request.QueryString("cst")

        breadTitle = "&nbsp;&nbsp;&raquo;&nbsp;&nbsp; <a>" & objMainCaseStudyitem.CaseStudyHeadline & "</a> "
        CType(Me.Parent.FindControl("breadcrumb"), Breadcrumb).SetHyperLinkField(breadcrumbNavigate, breadcrumblabel, breadTitle)

        'Find page control for meta description
        DirectCast(Me.Page, CaseStudyArticle).SetMetaData("", category.CategoryName.ToString() & " Case Studies | " & objMainCaseStudyitem.CaseStudyHeadline.ToString())

        Dim lbl As Label = Me.Parent.FindControl("labelPageTitle")
        lbl.Text = objMainCaseStudyitem.CaseStudyHeadline


        'Find div on master page
        Dim masterPage As main = DirectCast(Me.Page.Master, main)
        masterPage.BodyTag.Attributes.Add("class", category.DropDownValue.ToString())

        Dim strOutput As String = ""

        'Dim booMainImage As Boolean = False
        'If objMainCaseStudyItem.MainImage <> "" then
        '  booMainImage = True
        'End If
        lblCaseStudyText.Text = CheckStringValue(objMainCaseStudyitem.CaseStudyText)

        repHyp2.NavigateUrl = "~/CaseStudy/CaseStudies.html?cst=" & Request.QueryString("cst")
        'If booMainImage = True then

        'end if

    End Sub
  Private Function GetItem() As entMainCaseStudy
    Dim objMain As New dbMainCaseStudy
    Dim objMainEntity As entMainCaseStudy = objMain.GetItem(Request.QueryString("id"))
    Return objMainEntity
  End Function
  Private Function CheckStringValue(ByVal strInput As String) As String
    Dim strOutput As String = ""
    If not strInput is Nothing andalso strInput <> "" Then
            strOutput = strInput
    End If
    Return strOutput
  End Function
  
Private newPropertyValue As String
Public Property NewProperty() As String
    Get
        Return newPropertyValue 
    End Get
    Set(ByVal value As String)
        newPropertyValue = value
    End Set
End Property

End Class
