private void btnVoltar_Click(object sender, EventArgs e) { frmInicio inicio = new frmInicio(); this.Hide(); inicio.ShowDialog(); this.Close(); }
private void btnVoltar_Click(object sender, EventArgs e) { if (util.ConfirmaMsg("Deseja realmente sair?")) { frmInicio inicio = new frmInicio(); this.Hide(); inicio.ShowDialog(); this.Close(); } }
void voltar() { switch (formOption) { case 0: //login frmLogin login = new frmLogin(); this.Hide(); login.ShowDialog(); this.Close(); break; case 1: //admin dashboard if (!backToDash) { frmConsultaEmprestimo consultaEmprestimo = new frmConsultaEmprestimo(userId, formOption); this.Hide(); consultaEmprestimo.ShowDialog(); this.Close(); } else { frmDashboardAdm adm = new frmDashboardAdm(userId); this.Hide(); adm.ShowDialog(); this.Close(); } break; case 2: //user dashboard frmDashboard dash = new frmDashboard(userId); this.Hide(); dash.ShowDialog(); this.Close(); break; case 3: //inicio frmInicio inicio = new frmInicio(); this.Hide(); inicio.ShowDialog(); this.Close(); break; default: formOption = 3; voltar(); break; } }
void voltar() { switch (formOption) { case 0: //login frmLogin login = new frmLogin(); this.Hide(); login.ShowDialog(); this.Close(); break; case 1: //admin dashboard frmDashboardAdm adm = new frmDashboardAdm(userId); this.Hide(); adm.ShowDialog(); this.Close(); break; case 2: //user dashboard frmDashboard dash = new frmDashboard(userId); this.Hide(); dash.ShowDialog(); this.Close(); break; case 3: //inicio frmInicio inicio = new frmInicio(); this.Hide(); inicio.ShowDialog(); this.Close(); break; case 4: //selUser frmSelecionaUser selUser = new frmSelecionaUser(userId, formUser); this.Hide(); selUser.ShowDialog(); this.Close(); break; default: formOption = 3; voltar(); break; } }