Imports EDSL.Entities
Imports EDSL.DAL
Partial Public Class TestimonialDeleteControl
    Inherits System.Web.UI.UserControl
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If IsPostBack = False Then
            txtID.Value = Request.QueryString("id")
            lblName.Text = Request.QueryString("idtext")
        End If
    End Sub
    Protected Sub btnDelete_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.Click
        Call Deleteit(txtID.Value)
    End Sub
    Private Sub Deleteit(ByVal intID As Integer)
        Dim objMainAdmin As New dbMainTestimonial
        If objMainAdmin.DeleteItem(intID, Session("passover")) = True Then
            Response.Redirect("List.aspx")
        Else
            divErrorPanel.InnerHtml = "Error deleting Testimonial item"
        End If
    End Sub
    Protected Sub btnBack_click(ByVal sender As Object, ByVal e As EventArgs) Handles btnBack.Click
        If Request.QueryString("r") = "e" Then
            Response.Redirect("Edit.aspx?id=" & txtID.Value)
        Else
            Response.Redirect("List.aspx")
        End If
    End Sub
End Class