public partial class TelaQuadroAdm : Form
{
public TelaQuadroAdm()
{
InitializeComponent();
}
private void TelaQuadroAdm_Load(object sender, EventArgs e)
{
Quadro q = new Quadro();
List<Pais> l = new List<Pais>();
l = q.obterQuadro();
foreach (var pais in l)
{
object[] row = {
pais.posicao,
pais.sigla,
pais.nome,
pais.ouro,
pais.prata,
pais.bronze,
pais.total,
};
dataGridQuadroAdm.Rows.Add(row);
}
}
void BtnMaisClick(object sender, EventArgs e)
{
Hide();
TelaAdicionarPais tela = new TelaAdicionarPais(dataGridQuadroAdm);
tela.ShowDialog();
}
void BtnMenosClick(object sender, EventArgs e)
{
int linha = dataGridQuadroAdm.CurrentCell.RowIndex;
string sigla = (string)dataGridQuadroAdm.Rows[linha].Cells[1].Value;
Quadro q = new Quadro();
Hide();
q.remover(sigla);
TelaQuadroAdm tela = new TelaQuadroAdm();
tela.ShowDialog();
}
void BtnAlterarPaisClick(object sender, EventArgs e)
{
int linha = dataGridQuadroAdm.CurrentCell.RowIndex;
string sigla = (string)dataGridQuadroAdm.Rows[linha].Cells[1].Value;
Hide();
TelaAlterarPais tela = new TelaAlterarPais(sigla);
tela.ShowDialog();
}
void BtnGerenciarUsuarioClick(object sender, EventArgs e)
{
Hide();
TelaGerenciarUsuario tela = new TelaGerenciarUsuario();
tela.ShowDialog();
}
void BtnLogoutClick(object sender, EventArgs e)
{
Hide();
TelaQuadroVisitante tela = new TelaQuadroVisitante();
tela.ShowDialog();
}
void DataGridQuadroAdmCellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
}