Public Class Projekt_odstranit
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim sKategorie As String = Request.QueryString("kat")
        Dim sID As String = Request.QueryString("id")
        If sID = "" Then Exit Sub
        If sKategorie = "" Then Exit Sub
        If _UserID = "" Then Exit Sub

        DB.ExecuteCommand("DELETE FROM [projekty].[list] WHERE id = '" & sID & "'")
        DB.ExecuteCommand("DELETE FROM [projekty].[fotografie] WHERE projektid = '" & sID & "'")
        DB.ExecuteCommand("DELETE FROM [nastaveni].[adresy] WHERE strankaid = 200 AND zaznamid = '" & sID & "'")

        Dim pDelete As New PCSolution.DirectoryDelete
        Try
            Dim p As New PCSolution.DirectoryDelete
            p.Delete(_PathFoto & "\Projekty\" & sKategorie & "\" & sID)
        Catch ex As Exception
        End Try

        _NotifyText = "Reference je odstraněná."

        Response.Redirect("/id-" & sKategorie & gadrProjekty_seznam)

    End Sub

End Class