protected void btn_AddUser_Click(object sender, EventArgs e) {//Default username = first+last, default password = last+first; if (accountService.CreateUser(txt_AddFirst.Text, txt_AddLast.Text, txt_AddFirst.Text + txt_AddLast.Text, SecurityManager.Encrypt(txt_AddLast.Text + txt_AddFirst.Text))) { lbl_Result.Text = "New User Created! Inform User(Username:"******", Password:"******")."; } else { lbl_Result.Text = "Error creating user!"; } }
protected void btn_Register_Click(object sender, EventArgs e) { if (txt_regFirst.Text != "" && txt_regLast.Text != "" && txt_regUser.Text != "" && txt_regPass.Text != "") { string encryptPass = SecurityManager.Encrypt(txt_regPass.Text); //2b by Tydin Jarman if (validateService.CreateUser(txt_regFirst.Text, txt_regLast.Text, txt_regUser.Text, encryptPass /*txt_regPass.Text*/)) { lbl_result2.Text = "User successfully created!"; HttpCookie p5C = new HttpCookie("P5-A9A10-Cookie"); p5C["Username"] = txt_regUser.Text; p5C["Password"] = encryptPass;// txt_regPass.Text; p5C.Expires = DateTime.Now.AddDays(1d); Response.Cookies.Add(p5C); } else { lbl_result2.Text = "User not created!"; } } else { lbl_result2.Text = "Please fill in all details."; } }