Current Path : G:/PleskVhosts/mpcdp.in/cmamp.mpcdp.in/cdpp3/ |
Windows NT SG2NWVPWEB022 10.0 build 17763 (Windows Server 2016) i586 |
Current File : G:/PleskVhosts/mpcdp.in/cmamp.mpcdp.in/cdpp3/MasterPage4.master.vb |
Imports System.Threading Imports system.Globalization Partial Class MasterPage4 Inherits System.Web.UI.MasterPage Dim _satus, _Userid, _pass, _Adimnid, _FirstName Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ' hlPopUp.Attributes.Add("onclick", "showHelpPopUp()") ' TxtWaterMark1.Attributes.Add("onblur", "waterMarkText()") ' TxtWaterMark1.Attributes.Add("onfocus", "waterMarkText()") ' TxtWaterMark2.Attributes.Add("onblur", "waterMarkText(this,event)") ' TxtWaterMark2.Attributes.Add("onfocus", "waterMarkText(this,event)") '.Attributes.Add("onclick", "showHelpPopUp()") 'If Not IsPostBack Then ' TextBoxWatermark.WaterMarkHelper.ApplyWaterMarkToTextBox(UserName, "Type user name", "WaterMarkedTextBox", "NormalTextBox") 'End If End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Session("myobj") = "mymasterobj" 'HttpContext.Current.Items("UN") = txtLogin.Text 'HttpContext.Current.Items("pass") = Login_txtPassword.Text Dim contextLogin = TxtUserName.Text Dim contextPass = TxtUserPAssword.Text Context.Application.Add(contextLogin, True) Context.Application.Add(contextPass, True) Dim contextFirst = GetLOfinId(contextLogin, contextPass) Context.Application.Add(contextFirst, True) If Page.IsValid Then ' If Members.SignIn(txtLogin.Text, Authorization.Sha256(Login_txtPassword.Text), True) Then If Members.SignIn(TxtUserName.Text, TxtUserPAssword.Text, True) Then If Request.QueryString("ReturnUrl") IsNot Nothing Then Response.Redirect(Request.QueryString("ReturnUrl")) Else Context.Application.Add(contextLogin, True) Context.Application.Add(contextPass, True) Context.Application.Add(contextFirst, True) ' LblWelcome.Visible = True ' Session("loginuser") = txtLogin.Text ' Session("pass") = Login_txtPassword.Text ' TextBox2.Text = "y" If IsPostBack Then ' Page.ClientScript.RegisterStartupScript(Me.GetType, "onLoad", "ClickCrossBTN();", True) End If 'Server.HtmlEncode(TextBox1.Text) 'Server.UrlEncode(Request.Url.ToString()) Response.Redirect("default.aspx") Button1.Enabled = False End If Else msg.Visible = True msg.Text = "Invalid Username or Password. Please try again." ' CustomValidator2.IsValid = False ' cvPasswordValidation.IsValid = False If IsPostBack Then 'Page.ClientScript.RegisterStartupScript(Me.GetType, "onLoad", "ClickCrossBTN();", True) End If ' TextBoxDCountyClient(CustomValidator2, False) ' Page.IsValid = False '} 'Throw New FormatException("Unknown Username or Incorrect Password") End If End If ' Context.Items("un") = txtLogin.Text 'Context.Items("pas") = Login_txtPassword.Text ' Dim thisDropDown As Button = PreviousPage.Master.FindControl("Butt_Update") ' Dim thisDropDown As DropDownList = TryCast(Me.Master.FindControl("someDropDown"), DropDownList) ' userLabel.Text = thisDropDown.SelectedValue ' Dim customerName As String 'Dim ct As Control ' ct = Me.PreviousPage.FindControl("NameTextBox") ' ct = Me.FindControl("Butt_Update") '' customerName = CType(ct, Button).Visible = True 'Dim s = Context.Items("CityProfile_New").ToString 'Response.Redirect("default.aspx") 'If s <> "no" Then ' Response.Redirect(s) ' Context.Items("CityProfile_New") = "no" 'End If ' If IsPostBack Then ' Page.ClientScript.RegisterStartupScript(Me.GetType, "onclick", "showHelpPopUp();", True) ' End If End Sub Private Function GetLOfinId(ByVal un As String, ByVal ps As String) As String Dim _LU = un Dim _LP = ps Dim dsAdmin As New Data.DataSet() Global.Command.CreateSqlConnection() Dim da As New Data.SqlClient.SqlDataAdapter("select FirstName from Admin where Email='" & _LU & "' and Password ='" & _LP & "';", Global.Command.CreateSqlConnection()) ' DataTable dt = new DataTable(); da.Fill(dsAdmin, "Admin") Dim myDataTable As Data.DataTable = dsAdmin.Tables(0) For Each dRow As Data.DataRow In myDataTable.Rows _FirstName = dRow("FirstName").ToString() Next da.Dispose() myDataTable.Dispose() ' LblWelcome.Visible = True ' LblWelcome.Text = "Welome " + _FirstName Return _FirstName End Function Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click Button1.Enabled = True _satus = Session("status") ' Context.Application.AllKeys(0) = "" 'Context.Application.AllKeys(1) = "" ' Context.Application.AllKeys(2) = "" 'Context.Application.Clear() ' _Userid = Context.Application.AllKeys(0) '_pass = Context.Application.AllKeys(1) ' _Userid = Session("loginuser") ' _pass = Session("pass") '_Adimnid = Session("Adminid") 'If _satus = 3 Then ' Dim command As New Command("sp_Update_Admin", True) ' command.Parameters.AddWithValue("@AdminId", _Adimnid) ' command.Parameters.AddWithValue("@Email", _Userid) ' command.Parameters.AddWithValue("@Password", _pass) ' command.Parameters.AddWithValue("@Status", 2) ' command.ExecuteNonQuery() 'End If ' Session.Clear() ' Session.Abandon() 'FormsAuthentication.SignOut() ' LblWelcome.Text = "Logout" '------------------ Context.Application.Clear() Session.Clear() Session("dt") = DBNull.Value Session.Abandon() FormsAuthentication.SignOut() Response.Redirect("~/Default.aspx") End Sub End Class