Imports Microsoft.VisualBasic
Imports Microsoft.VisualBasic.CompilerServices
Imports System
Imports System.Runtime.CompilerServices
Imports System.Web.Profile
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls

Public Class Search
    Inherits Page
    Implements IRequiresSessionState
    ' Methods
    Public Sub New()
        AddHandler MyBase.Load, New EventHandler(AddressOf Me.Page_Load)
    End Sub

 Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim num As Integer
        Dim flag As Boolean
        If (Me.btnSearch.Text = ChrW(1576) & ChrW(1600) & ChrW(1581) & ChrW(1600) & ChrW(1600) & ChrW(1600) & ChrW(1579)) Then
            Dim nullable As Nullable(Of Integer)
            Dim nullable2 As Nullable(Of Integer)
            Dim str As String
            Dim text As String
            Dim str3 As String
            Dim nullable3 As Nullable(Of Short)
            If (Me.txtempid.Text <> "") Then
                nullable2 = Conversions.ToInteger(Me.txtFamNo.Text)
                If Me.cv_famno.IsValid Then
                    num += 1
                End If
            Else
                nullable2 = Nothing
            End If
            If (Me.txtempname.Text <> "") Then
                nullable3 = Conversions.ToShort(Me.txtVRC.Text)
                If Me.cv_vrc.IsValid Then
                    num += 1
                End If
            Else
                nullable3 = Nothing
            End If
            If (Me.txtempdep.Text <> "") Then
                nullable = Conversions.ToInteger(Me.txtVoterID.Text)
                If Me.CV_ID.IsValid Then
                    num += 1
                End If
                flag = True
            Else
                nullable = Nothing
            End If
            
        Else
            Me.txtempid.Text = ""
            Me.txtempname.Text = ""
            Me.txtempdep.Text = ""
            
        End If
        If (Not (flag Or (num > 1)) AndAlso (Me.btnSearch.Text <> ChrW(1576) & ChrW(1600) & ChrW(1581) & ChrW(1600) & ChrW(1600) & ChrW(1600) & ChrW(1579))) Then
            Me.btnSearch.Text = ChrW(1576) & ChrW(1600) & ChrW(1581) & ChrW(1600) & ChrW(1600) & ChrW(1600) & ChrW(1579)
        End If
    End Sub
Protected Sub Search_DS_Selecting(ByVal sender As Object, ByVal e As SqlDataSourceSelectingEventArgs)
        If Not Me.Page.IsPostBack Then
            e.Cancel = True
        End If
    End Sub
 Protected Overridable Property btnSearch As Button
        Get
            Return Me._btnSearch
        End Get
        <MethodImpl(MethodImplOptions.Synchronized)> _
        Set(ByVal WithEventsValue As Button)
            Dim handler As EventHandler = New EventHandler(AddressOf Me.btnSearch_Click)
            If (Not Me._btnSearch Is Nothing) Then
                RemoveHandler Me._btnSearch.Click, handler
            End If
            Me._btnSearch = WithEventsValue
            If (Not Me._btnSearch Is Nothing) Then
                AddHandler Me._btnSearch.Click, handler
            End If
        End Set
    End Property
 <AccessedThroughProperty("btnSearch")> _
    Private _btnSearch As Button