示例#1
0
 private void btnAtivarTema_Click(object sender, EventArgs e)
 {
     if (dgvTemaAtivo.Rows.Count == 0 && DgvTema.Rows.Count > 0)
     {
         modelTema.Codigo = Convert.ToInt32(DgvTema.CurrentRow.Cells["Codigo"].Value.ToString());
         if (controllerTema.AtivarTema(modelTema))
         {
             CarregarTemas();
             MessageBox.Show("Tema atual definido com sucesso!\nReinicie o sistema para aplicar", "Alerta!", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
示例#2
0
 private void btnAtivarTema_Click(object sender, EventArgs e)
 {
     if (dgvTemaAtivo.Rows.Count == 0 && DgvTema.Rows.Count > 0)
     {
         modelTema.Codigo = Convert.ToInt32(DgvTema.CurrentRow.Cells["Codigo"].Value.ToString());
         var result = MessageBox.Show("Ao ativar um novo tema, é necessário reiniciar o sistema\nDeseja ativar o tema agora?", "Alerta!", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (result == DialogResult.Yes && controllerTema.AtivarTema(modelTema))
         {
             CarregarTemas();
             MessageBox.Show("Tema atual definido com sucesso!\nO sistema será reiniciado!", "Alerta!", MessageBoxButtons.OK, MessageBoxIcon.Information);
             btnAtivarTema.Enabled    = false;
             btnDesativarTema.Enabled = false;
             retornoTema = true;
             this.Close();
         }
     }
 }