private void btnIngresar_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(txtUsername.Text) || string.IsNullOrEmpty(txtPassword.Text)) { Utility.ShowInfo("Advertencia", "No puede estar vacio el username o el password"); return; } UsuarioDTO usuario = Sesion.login(txtUsername.Text, txtPassword.Text); if (usuario.rolesList.Count > 1) { this.Hide(); SelectRolLogin selectRolLogin = new SelectRolLogin(usuario.rolesList); selectRolLogin.ShowDialog(); Close(); } else { Sesion.RolActual = usuario.rolesList.First(); this.Hide(); MenuHome menu = new MenuHome(); menu.ShowDialog(); Close(); } } catch (ApplicationException ex) { Utility.ShowError("Error", ex); } }
// GAME METHODS public void Update(GameTime gameTime, Input input) { switch (menuState) { case MenuState.HOME: this.menuHome.Update(gameTime, input); this.menuGame = new MenuGame(); break; case MenuState.GAME: this.menuGame.Update(gameTime, input); this.menuHome = new MenuHome(); this.menuGO = new MenuGO(); break; case MenuState.GO: this.menuGO.Update(gameTime, input); this.menuHome = new MenuHome(); break; default: break; } }
public MenuManager(MenuState ms) { menuState = ms; this.menuGame = new MenuGame(); this.menuHome = new MenuHome(); this.menuGO = new MenuGO(); }
private void buttonIngresar_Click(object sender, EventArgs e) { if (comboBoxRoles.SelectedIndex == -1) { MessageBox.Show("Seleccione algun rol para ingresar"); } else { Sesion.RolActual = (RolDTO)comboBoxRoles.SelectedItem; this.Hide(); MenuHome menu = new MenuHome(); menu.ShowDialog(); Close(); } }