protected void Button1_Click(object sender, EventArgs e) { string fName = firstName.Text; string lname = lastName.Text; string userName = UserName.Text; string password = Password.Text; if (password != Cpassword.Text) { Password.Focus(); } int labId = int.Parse(LabList.SelectedValue); ServiceLayerPerson person = new ServiceLayerPerson(); if (!person.CheckUserName(userName)) { person.InsertPerson(fName, lname, userName, password, 1); Response.Redirect("LogIn.aspx"); } else { TextBox1.Text = "UserName already exist"; } }
protected void Page_Load(object sender, EventArgs e) { if (Session != null) { try { ServiceLayerPerson sv = new ServiceLayerPerson(); string username = Session["UserName"].ToString(); int id = sv.FindIdByUsername(username); Session["ObjectParameterName"] = id; }catch {} } }
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { string username = Login1.UserName; string password = Login1.Password; ServiceLayerPerson sv = new ServiceLayerPerson(); if (sv.CheckTheLogIn(username, password)) { Session["UserName"] = username; Response.Redirect("MemberPage.aspx"); } else { TextBox1.Text = "Unable to Login. Please make sure Caps is turned of"; } }