Imports EDSL.Entities
Imports EDSL.DAL
Public Partial Class NLDeleteControl
  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 dbMainNLR
    if objMainAdmin.DeleteItem(intID, session("passover")) = True then
      Response.Redirect("List.aspx")
    Else
      divErrorPanel.InnerHtml = "Error deleting newsletter recipient"
    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
