Login Form.vb
Imports SystemImports System.CollectionsImports System.ConfigurationImports System.DataImports System.LinqImports System.WebImports System.Web.SecurityImports System.Web.UIImports System.Web.UI.HtmlControlsImports System.Web.UI.WebControlsImports System.Web.UI.WebControls.WebPartsImports System.Xml.LinqImports System.Data.SqlClientPartial
Public Class Default2Inherits System.Web.UI.PageDim c1 As clsConnection = New clsConnection()Dim ds As DataSet = New DataSet()Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)End Sub
Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As EventArgs)If txtLoginId.Text <> "" And txtPassword.Text <> "" ThenDim getAdmin As String = "select * from oee_LoginTable where signum_id='" + txtLoginId.Text + "' and Password='" + txtPassword.Text + "'"ds = c1.selectds(getAdmin)
If ds.Tables(0).Rows.Count > 0 Then
Dim utype As String = ds.Tables(0).Rows(0)("UserType").ToString()If utype = "1" ThenSession(
Response.Redirect(
"signumid") = ds.Tables(0).Rows(0)("signum_id").ToString()"User_Home.aspx")ElseEnd IfElse
End Ifclr()
ElseEnd IfEnd Sub
Response.Redirect(
Protected Sub btnBack_Click(ByVal sender As Object, ByVal e As EventArgs)"../Default.aspx")End Sub
txtLoginId.Text = Public Sub clr()""txtPassword.Text = ""
EndEnd Sub Class
Imports SystemImports System.CollectionsImports System.ConfigurationImports System.DataImports System.LinqImports System.WebImports System.Web.SecurityImports System.Web.UIImports System.Web.UI.HtmlControlsImports System.Web.UI.WebControlsImports System.Web.UI.WebControls.WebPartsImports System.Xml.LinqImports System.Data.SqlClientPartial
Public Class Default2Inherits System.Web.UI.PageDim c1 As clsConnection = New clsConnection()Dim ds As DataSet = New DataSet()Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)End Sub
Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As EventArgs)If txtLoginId.Text <> "" And txtPassword.Text <> "" ThenDim getAdmin As String = "select * from oee_LoginTable where signum_id='" + txtLoginId.Text + "' and Password='" + txtPassword.Text + "'"ds = c1.selectds(getAdmin)
If ds.Tables(0).Rows.Count > 0 Then
Dim utype As String = ds.Tables(0).Rows(0)("UserType").ToString()If utype = "1" ThenSession(
Response.Redirect(
"signumid") = ds.Tables(0).Rows(0)("signum_id").ToString()"User_Home.aspx")ElseEnd IfElse
End Ifclr()
ElseEnd IfEnd Sub
Response.Redirect(
Protected Sub btnBack_Click(ByVal sender As Object, ByVal e As EventArgs)"../Default.aspx")End Sub
txtLoginId.Text = Public Sub clr()""txtPassword.Text = ""
EndEnd Sub Class
No comments:
Post a Comment