private void buttonAddUsers_Click(object sender, EventArgs e) { if (textBoxEditUserName.Text == "") { MessageBox.Show("Please fill the required information", "Error"); } else { try { DBL.User user = new DBL.User(); user.Name1 = textBoxEditUserName.Text; user.Username1 = textBoxEditUserUsername.Text; user.Password1 = textBoxEditUserPassword.Text; user.Mobile1 = textBoxEditUserMobile.Text; user.Branch1 = textBoxEditUserBranch.Text; user.addUser(user); MessageBox.Show("Inserted Well", "Success"); allUserTable(); textBoxEditUserName.Text = ""; textBoxEditUserUsername.Text = ""; textBoxEditUserPassword.Text = ""; textBoxEditUserMobile.Text = ""; textBoxEditUserBranch.Text = ""; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } } }