private void btnConsultaEmprestimo_Click(object sender, EventArgs e) { frmConsultaEmprestimo consEmprestimo = new frmConsultaEmprestimo(idUser, 1); this.Hide(); consEmprestimo.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; } }