private void resgiterButton_Click(object sender, EventArgs e) { string name = nameTextBox.Text; string email = emailTextBox.Text; string password = passwordTextBox.Text; string phone = phoneTextBox.Text; if (name != "" && email != "" && password != "" && phone != "") { server.usersParent user = new server.usersParent(); user = myserver.getUserBYEmail(email); if (user == null) { myserver.addUser(name, email, password, phone); Main homeControl = new Main(); // ADD HO GYA KA SUCCESS MESSAGE SHOW KARE OnregisteredSuccess(); } else { errorAlreadyExists.Show(); // PEHLE SE USER MOJOOD HAI KA ERROR SHOW KARE } } else { // ERROR SHOW KARWAE KE BHAE JAN FIELDS TO PEHLE SARI FIL KARO errorRequiredFields.Show(); } }
private void loginMenuButton_Click(object sender, EventArgs e) { string name = nametxtbox.Text; string email = emailtxtbox.Text; string password = passtxtbox.Text; string username = usernametxtbox.Text; string phone = phonetxtbox.Text; if (this_user == null) { myserver.addUser(name, email, password, phone); } else { myserver.updateUser(this_index.ToString(), name, email, password, phone); } Onuseradded(); this.Hide(); }