protected void btn_register_staff_Click(object sender, EventArgs e) { UserRegistrationService.Service1Client proxy = new UserRegistrationService.Service1Client(); //Ensure entry not null if (!String.IsNullOrWhiteSpace(txt_register_staffname.Text) && !String.IsNullOrWhiteSpace(txt_register_staffpass.Text)) { //Call the operation to register Boolean created = proxy.registerStaff(txt_register_staffname.Text, Class1.Encrypt(txt_register_staffpass.Text)); //Set label to the apt response if (created) { Label3.Text = "User successfully Registered in Staff.xml!"; Label3.ForeColor = System.Drawing.Color.Green; } else { Label3.Text = "User already registered in Staff.xml!"; Label3.ForeColor = System.Drawing.Color.Red; } } else { Label3.Text = "Enter Valid Username and password!"; Label3.ForeColor = System.Drawing.Color.Red; } }
protected void btn_register_Click1(object sender, EventArgs e) { //save to xml file try { UserRegistrationService.Service1Client client = new UserRegistrationService.Service1Client(); Boolean response = client.registerStaff(UserInput.Text, Class1.Encrypt(PasswordInput.Text)); // Adding the user by manipulating XML file if (response.Equals(true)) { // Error.Text = "User has been registered Successfully!"; Session["registration1"] = "success"; Response.Redirect("StaffLogin.aspx"); } else if (response.Equals(false)) { Error.Text = "Username already exist! Provide a new username"; } else { Error.Text = "Username or password is incorrect!!"; //Error.Text = response; } //} } catch (Exception e1) { Error.Text = e1.Message; } }