public static bool IsEqual(userInfo user1, userInfo user2) { if (user1 == null || user2 == null) { return(false); } if (user1.usernameV != user2.usernameV) { error = "Username does not exist!"; return(false); } else if (user1.passwordV != user2.passwordV) { error = "Username does not match password!"; return(false); } return(true); }
private void LgnButton_Click(object sender, EventArgs e) { FirebaseResponse res = Client.Get("Users/" + username.Text); userInfo ResUser = res.ResultAs <userInfo>(); //DATABASE RESULTS userInfo CurUser = new userInfo() // USER GIVIN INFO { usernameV = username.Text, passwordV = password.Text }; if (userInfo.IsEqual(ResUser, CurUser)) { this.Hide(); TestForm Test = new TestForm(); Test.ShowDialog(); } else { userInfo.ShowError(); } }