protected void btnSaveEmpl_Click(object sender, EventArgs e) { User user = new User { Name = name.Value, Username = username.Value, Email = email.Value, Password = Secrecy.HashPassword(pass.Value), Tel_Number = telnum.Value, Address = address.Value, Gender = GenderList.SelectedItem.ToString(), DOB = dob.Value, User_Type = Utype.SelectedItem.ToString(), pphoto = "image.file" }; string result = client.RegisterUser(user); Response.Redirect("ManageUsers.aspx"); }
protected void btnLogin_Click(object sender, EventArgs e) { string usernam = username.Value; string Password = Secrecy.HashPassword(userpassword.Value); usrclient = new UserServiceClient(); if (Session["Username"] == null) { if (usrclient.LoginUser(usernam, Password) == true) { Session["Username"] = usernam; Response.Redirect("dashboard.aspx"); } else { error.InnerHtml = "Error: Invalid Credentials"; Session["Username"] = null; } } }