//Submit Button private async void SigninBtn_Click(object sender, EventArgs e) { //Check if Id and password are not empty if (NameBox.Text != "" && PassBox.Text != "") { //If Login Case if (SigninBtn.ButtonText == "Login") { //DOLOGIN : by Sending user and pw to reader Class of data base SignInResult resutl = LoginSys.SignIn(NameBox.Text, PassBox.Text); if (resutl.LoggedIn) { //If Login Operation Successfull , Show the Ui LoginPanel.Dock = DockStyle.None; LoginPanel.Hide(); LoginPanel.SendToBack(); UserLabel.Show(); UserBtn.Show(); DetectBtn.Show(); TrainBtn.Show(); LockBtn.Show(); ExitBtn.Show(); mark2.Show(); UserLabel.Text = resutl.UserData.Name.ToUpperInvariant(); DetectionPanel.Show(); } else { label3.Text = resutl.Reason; } } else { //If Registration Senario : Sending User and pw to Writer Class bool suResult = await LoginSys.SignUp(NameBox.Text, PassBox.Text, "", 0); if (suResult) { label3.Text = "Registration Done Sucessfully"; } } } }
private void AuthenticationForm_Load(object sender, EventArgs e) { //CCurrentUser.User_name = m_userName; UserLabel.Text = m_userName; UserLabel.Show(); }