示例#1
0
        private void pictureBoxButtonReset_Click(object sender, EventArgs e)
        {
            if (listaCLubes != null)
            {
                if (listaCLubes.Count < 1)
                {
                    return;
                }
            }

            FormPopUp    PopupConfirmation = new FormPopUp("Tem a certeza que pertende continuar?");
            DialogResult resultado         = PopupConfirmation.ShowDialog();

            if (resultado == DialogResult.Yes)
            {
                try
                {
                    Funcionalidades.EliminarTodosClubes();
                }
                catch
                {
                    _FormInicio.EscreverNaConsola("Erro ao eliminar os clubes...");
                }

                _FormInicio.EscreverNaConsola("Clubes elimidados!");
                CarregarListaClubes();
            }
        }
 private void GuildConfig_Click(object sender, EventArgs e)
 {
     UCGuildConfig guildConfig;
     if (sender == picBoxAllianceConfig)
     {
         guildConfig = new UCGuildConfig(true);
     }
     else
     {
         guildConfig = new UCGuildConfig(false);
     }
     guildConfig.GuildChangedEvent += new UCGuildConfig.GuildChanged(guildConfig_GuildChangedEvent);
     FormPopUp popUp = new FormPopUp(guildConfig);
     popUp.ShowDialog();
 }
示例#3
0
        private void buttonModeloApagar_Click(object sender, EventArgs e)
        {
            //Apagar
            FormPopUp    PopupConfirmation = new FormPopUp("Tem a certeza que pertende continuar?");
            DialogResult resultadoPopup    = PopupConfirmation.ShowDialog();

            if (resultadoPopup == DialogResult.Yes)
            {
                try
                {
                    Funcionalidades.EliminarModelo(EsteModelo);
                    _FormInicio.EscreverNaConsola(EsteModelo.Nome + " eliminado!");
                    _FormInicio.MudarParaAGaleria();
                }
                catch
                {
                    _FormInicio.EscreverNaConsola("Erro ao eliminar o Modelo!");
                }
            }
        }
示例#4
0
        private void listViewClubes__DoubleClick(object sender, EventArgs e)
        {
            if (listViewClubes_.SelectedIndices.Count <= 0)
            {
                return;
            }

            int _ID = Convert.ToInt32(listViewClubes_.GetSelectedItem().Tag);

            //Se for para abrir
            if (!_FormInicio.VerificarEditarInstrucao())
            {
                return;
            }

            foreach (Clube clb in listaCLubes)
            {
                if (clb.ID == _ID)
                {
                    FormEditarClube PopupEditar = new FormEditarClube(clb);
                    DialogResult    resultado   = PopupEditar.ShowDialog();

                    if (resultado == DialogResult.OK)
                    {
                        string NovoNome = PopupEditar.NomeEditado;
                        string NovaFoto = PopupEditar.FotoEditada;

                        //Verificar se os dados foram editados
                        if (NovoNome == "nop" && NovaFoto == "nop")
                        {
                            return;
                        }

                        string[] parts = NovaFoto.Split('\\');
                        if (clb.Nome == NovoNome && clb.NomeFoto == parts[parts.Count() - 1])
                        {
                            return;
                        }

                        //Editar
                        if ((NovoNome != "nop" && NovoNome != clb.Nome) || (clb.NomeFoto != parts[parts.Count() - 1] && NovaFoto != "nop"))
                        {
                            Funcionalidades.EditarClube(NovoNome, NovaFoto, clb);
                            _FormInicio.EscreverNaConsola(NovoNome + " editado!");
                            CarregarListaClubes();
                        }
                    }
                    else if (resultado == DialogResult.Ignore)
                    {
                        //Apagar
                        FormPopUp    PopupConfirmation = new FormPopUp("Tem a certeza que pertende continuar?");
                        DialogResult resultadoPopup    = PopupConfirmation.ShowDialog();

                        if (resultadoPopup == DialogResult.Yes)
                        {
                            try
                            {
                                Funcionalidades.EliminarClube(clb);
                                _FormInicio.EscreverNaConsola(clb.Nome + " eliminado!");
                                CarregarListaClubes();
                            }
                            catch
                            {
                                _FormInicio.EscreverNaConsola("Erro ao eliminar o clube...");
                            }
                        }
                    }

                    break;
                }
            }
        }
示例#5
0
        private void listViewErmos_DoubleClick(object sender, EventArgs e)
        {
            if (listViewErmos.SelectedIndices.Count <= 0)
            {
                return;
            }

            int _ID = Convert.ToInt32(listViewErmos.GetSelectedItem().Tag);

            //Se for para abrir
            if (!_FormInicio.VerificarEditarInstrucao())
            {
                return;
            }

            foreach (Ermo rm in ListaErmos)
            {
                if (rm.ID == _ID)
                {
                    FormEditarErmo PopupEditar = new FormEditarErmo(rm.Designacao);
                    DialogResult   resultado   = PopupEditar.ShowDialog();

                    if (resultado == DialogResult.OK)
                    {
                        string NovoNome = PopupEditar.NomeEditado;

                        //Verificar se os dados foram editados
                        if (NovoNome == rm.Designacao)
                        {
                            return;
                        }

                        //Editar
                        if (!String.IsNullOrEmpty(NovoNome))
                        {
                            Funcionalidades.EditarErmo(NovoNome, rm);
                            _FormInicio.EscreverNaConsola("Ermo editado!");
                            CarregarErmos();
                        }
                    }
                    else if (resultado == DialogResult.Ignore)
                    {
                        //Apagar
                        FormPopUp    PopupConfirmation = new FormPopUp("Tem a certeza que pertende continuar?");
                        DialogResult resultadoPopup    = PopupConfirmation.ShowDialog();

                        if (resultadoPopup == DialogResult.Yes)
                        {
                            try
                            {
                                Funcionalidades.EliminarErmo(rm);
                                _FormInicio.EscreverNaConsola("Ermo eliminado!");
                                CarregarErmos();
                            }
                            catch
                            {
                                _FormInicio.EscreverNaConsola("Erro ao eliminar o Ermo...");
                            }
                        }
                    }

                    break;
                }
            }
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAddRealm_Click(object sender, EventArgs e)
 {
     UCRealmAdd ucRealmAdd = new UCRealmAdd();
     ucRealmAdd.newRealmInc += new UCRealmAdd.newRealm(UpdateRealms);
     FormPopUp popUp = new FormPopUp(ucRealmAdd);
     popUp.ShowDialog();
 }
 /// <summary>btnEdit_Click
 /// Ruft das Bearbeiten Menü für den Realm auf
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnEdit_Click(object sender, EventArgs e)
 {
     RealmLabel realmLabel = new RealmLabel();
     PictureBox btnEdit = (PictureBox)sender;
     foreach (RealmLabel rlb in realmLabelList)
     {
         if (rlb.EditButton == btnEdit)
             realmLabel = rlb;
     }
     UCRealmEdit ucRealmEdit = new UCRealmEdit(realmLabel.Adresse, realmLabel.Text, realmLabel.Id);
     ucRealmEdit.newRealmInc += new UCRealmEdit.newRealm(UpdateRealms);
     FormPopUp popUp = new FormPopUp(ucRealmEdit);
     popUp.ShowDialog();
 }
 /// <summary>UpdatePlayerOnline
 /// Erneuert die aktuellen Spielerzahlen
 /// </summary>
 private void picBoxVote_Click(object sender, EventArgs e)
 {
     UCVote ucVote = new UCVote();
     FormPopUp popUp = new FormPopUp(ucVote);
     popUp.ShowDialog();
 }
 private void picBoxArsenal_Click(object sender, EventArgs e)
 {
     UCArsenal ucArsenal = new UCArsenal();
     FormPopUp popUp = new FormPopUp(ucArsenal);
     popUp.ShowDialog();
 }
示例#10
0
        private void listViewGaleria_DoubleClick(object sender, EventArgs e)
        {
            if (listViewGaleria.SelectedIndices.Count <= 0)
            {
                return;
            }

            int _ID = Convert.ToInt32(listViewGaleria.GetSelectedItem().Tag);


            //Se for para abrir
            if (!_FormInicio.VerificarEditarInstrucao())
            {
                try
                {
                    //Mostrar Modelo
                    Modelo esteMdl = Funcionalidades.BuscarModelo(_ID);
                    _FormInicio.MostrarModelo(esteMdl);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.ToString());
                    Console.WriteLine(ex.Message);
                    _FormInicio.EscreverNaConsola("Erro ao ver Modelo");
                }

                return;
            }

            //PARA EDITAR
            foreach (Modelo mdl in ListaModelos)
            {
                if (mdl.ID == _ID)
                {
                    FormEditarModelo PopupEditar = new FormEditarModelo(mdl, true, _FormInicio);
                    DialogResult     resultado   = PopupEditar.ShowDialog();

                    if (resultado == DialogResult.OK)
                    {
                        string NovoNome = PopupEditar.NomeEditado;
                        string NovaFoto = PopupEditar.FotoEditada;

                        //Verificar se os dados foram editados
                        if (NovoNome == mdl.Nome && NovaFoto == mdl.CaminhoFoto)
                        {
                            return;
                        }

                        //Editar
                        if ((!String.IsNullOrEmpty(NovoNome) && NovoNome != mdl.Nome) || (!String.IsNullOrEmpty(NovaFoto) && NovaFoto != mdl.CaminhoFoto))
                        {
                            try
                            {
                                Funcionalidades.EditarModelo(NovoNome, NovaFoto, mdl);
                                _FormInicio.EscreverNaConsola(NovoNome + " editado!");
                                CarregarModelos();
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine(ex.ToString());
                                Console.WriteLine(ex.Message);
                                _FormInicio.EscreverNaConsola("Erro ao editar" + NovoNome);
                            }
                        }
                    }
                    else if (resultado == DialogResult.Ignore)
                    {
                        //Apagar
                        FormPopUp    PopupConfirmation = new FormPopUp("Tem a certeza que pertende continuar?");
                        DialogResult resultadoPopup    = PopupConfirmation.ShowDialog();

                        if (resultadoPopup == DialogResult.Yes)
                        {
                            try
                            {
                                Funcionalidades.EliminarModelo(mdl);
                                _FormInicio.EscreverNaConsola(mdl.Nome + " eliminado!");
                                CarregarModelos();
                            }
                            catch
                            {
                                _FormInicio.EscreverNaConsola("Erro ao eliminar o Modelo!");
                            }
                        }
                    }

                    break;
                }
            }
        }