private void ConnectLastUser() { if (isCreateAdmin) { return; } var LastUser = Firebird.ReturnLastUser(); txtUser.Text = LastUser.UserName; txtPassword.Text = LastUser.Password; btLogin_Click(null, null); }
private void CheckUser() { var admin = Firebird.ReturnAdmin(); if (admin.UserName == null) { MessageBox.Show("É necessário criar uma conta para o administrador", "Aviso!", MessageBoxButtons.OK); ListaUsuarios form = new ListaUsuarios(true); form.ShowDialog(); CheckUser(); return; } CurrentUser = Firebird.ReturnLastUser(); lbUser.Text = CurrentUser.UserName; if (CurrentUser.IsAdmin == 1) { lbUser.Text += " (admin)"; btnReset.Enabled = true; } }