Imports System.Data
Imports System.Data.SqlClient
Partial Class BusinessAssociates_SSA_Profile
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            FillSSADetails()
        End If
    End Sub

    Public Sub FillSSADetails()

        Dim cmd As New Data.SqlClient.SqlCommand()
        Dim con As New Data.SqlClient.SqlConnection
        con.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("ConnectionString")

        Dim Str As String
        Str = "select * From SSA_Master Where SSA_KID='" & Session("SSAID").ToString & "'"
        If con.State = Data.ConnectionState.Open Then
            con.Close()
        End If
        con.Open()
        cmd = New SqlCommand(Str, con)
        Dim adp As New SqlDataAdapter
        Dim ds As New DataSet
        Dim Dr As DataRow
        adp.SelectCommand = cmd
        adp.Fill(ds)

        If ds.Tables(0).Rows.Count > 0 Then
            Dr = ds.Tables(0).Rows(0)
            lblname.Text = Dr("SSA_FirstName")
            lbllastname.Text = Dr("SSA_LastName")

            txtSSAID.Text = Session("SSAID").ToString
            Dim dob, jdob As Date
            jdob = Dr("SSA_joiningdate")
            Lbljoindate.Text = jdob.ToString("dd-MMM-yyyy")
            dob = Dr("SSA_DOB")
            Lbldob.Text = dob.ToString("dd-MMM-yyyy")

            Lbladdress.Text = Dr("SSA_ContactAddress")
            Lblemailaddress.Text = Dr("SSA_EmailAddress")
            lbleduqual.Text = Dr("SSA_Eduqualification")
            lblprofqual.Text = Dr("SSA_profqualification")
            lblcurrentloc.Text = Dr("SSA_currentlocation")
            lblprefloc.Text = Dr("SSA_Preferredlocation")
            Lblcompanyname.Text = Dr("ssa_Nameofcompany")
            Lbldesg.Text = Dr("SSA_designation")
            Lblexp.Text = Dr("SSA_experience")

        End If

        ds.Clear()
        ds.Dispose()

        con.Close()
        con.Dispose()

    End Sub

    'Protected Sub cmdSubmit_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles cmdSubmit.Click
    '    Try

    '        Dim cmd As New Data.SqlClient.SqlCommand()
    '        Dim con As New Data.SqlClient.SqlConnection
    '        con.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("ConnectionString")

    '        cmd.CommandText = "Update_SSAProfile_Proc"
    '        cmd.CommandType = Data.CommandType.StoredProcedure
    '        cmd.Connection = con

    '        con.Open()
    '        cmd.Parameters.Add("@SSAID", Data.SqlDbType.VarChar).Value = txtSSAID.Text.Trim
    '        cmd.Parameters.Add("@FirstName", Data.SqlDbType.NVarChar, 100).Value = txtFirstName.Text.Trim
    '        cmd.Parameters.Add("@LastName", Data.SqlDbType.NVarChar, 100).Value = txtLastName.Text.Trim

    '        If txtDateOfBirth.Text.Trim <> "" Then
    '            If IsDate(txtDateOfBirth.Text.Trim) Then
    '                cmd.Parameters.Add("@DateOFBirth", Data.SqlDbType.DateTime).Value = txtDateOfBirth.Text.Trim
    '            Else
    '                showmessage("Please enter valid date", lblErrorData1)
    '                Exit Sub
    '            End If
    '        End If

    '        cmd.Parameters.Add("@Address", Data.SqlDbType.NVarChar, 100).Value = txtAddress.Text.Trim
    '        cmd.Parameters.Add("@EmailAddress", Data.SqlDbType.NVarChar, 100).Value = txtEmailID.Text.Trim
    '        cmd.Parameters.Add("@Password", Data.SqlDbType.NVarChar, 50).Value = ""
    '        cmd.Parameters.Add("@Document1", Data.SqlDbType.NVarChar, 500).Value = ""
    '        cmd.Parameters.Add("@Document2", Data.SqlDbType.NVarChar, 500).Value = ""
    '        cmd.Parameters.Add("@Document3", Data.SqlDbType.NVarChar, 500).Value = ""
    '        cmd.Parameters.Add("@FormName", Data.SqlDbType.NVarChar, 100).Value = Me.Title.ToString
    '        cmd.Parameters.Add("@Mode", Data.SqlDbType.NVarChar, 20).Value = "UpdateProfile"

    '        cmd.ExecuteNonQuery()

    '        showmessage("Your Profile has been updated.", lblErrorData1)

    '    Catch ex As Exception
    '        showmessage("Please try again later.", lblErrorData1)
    '    Finally
    '        con.Close()
    '        con.Dispose()
    '    End Try
    'End Sub
End Class
