private void alterar_Click(object sender, EventArgs e)
        {
            try
            {
                eventos.AltEvento(Convert.ToInt32(idalterar.Value), Edescricao.Text, Elocal.Text, Edata.Value, Convert.ToInt32(Elimite.Value), Convert.ToInt32(EidadeMinima.Value), Convert.ToInt32(EidadeMaxima.Value), Etipo.Text);
                Mostrar.DataSource = eventos.GetEvento();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            idalterar.Value = 0;
            Edescricao.Clear();
            Elocal.Clear();
            Edata.Value        = DateTime.Now;
            Elimite.Value      = 0;
            EidadeMinima.Value = 0;
            EidadeMaxima.Value = 0;
            Etipo.Clear();
        }
        private void AdicionarEvento_Click(object sender, EventArgs e)
        {
            Geventos.Visible  = true;
            Gfilho.Visible    = false;
            Gescola.Visible   = false;
            Ganimador.Visible = false;

            GRem.Visible = true;
            GAlt.Visible = true;

            QualAdicionar = "evento";

            Edescricao.Clear();
            Elocal.Clear();
            Edata.Value        = DateTime.Now;
            Elimite.Value      = 0;
            EidadeMinima.Value = 0;
            EidadeMaxima.Value = 0;
            Etipo.Clear();

            Mostrar.DataSource = eventos.GetEvento();
        }
Example #3
0
 public Auto(int cantPuertas, Etipo tipo, ECombustible combustible, int cantPasajeros) : base(tipo, combustible, cantPasajeros)
 {
     this.cantPuertas = cantPuertas;
 }
Example #4
0
 public Velero(double precio, Etipo tipo, ECombustible combustible, int cantPasajeros) : base(tipo, combustible, cantPasajeros)
 {
     this.precio = precio;
 }
 public Carreta(int cantCavallos, Etipo tipo, ECombustible combustible, int cantPasajeros) : base(tipo, combustible, cantPasajeros)
 {
     this.cantCaballos = cantCaballos;
 }
        private void Adicionar_Click(object sender, EventArgs e)
        {
            if (QualAdicionar == "evento")
            {
                try
                {
                    eventos.AddEvento(Edescricao.Text, Elocal.Text, Edata.Value, Convert.ToInt32(Elimite.Value), Convert.ToInt32(EidadeMinima.Value), Convert.ToInt32(EidadeMaxima.Value), Etipo.Text);
                    Mostrar.DataSource = eventos.GetEvento();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                Edescricao.Clear();
                Elocal.Clear();
                Edata.Value        = DateTime.Now;
                Elimite.Value      = 0;
                EidadeMinima.Value = 0;
                EidadeMaxima.Value = 0;
                Etipo.Clear();
            }
            if (QualAdicionar == "inscricao")
            {
                var idadeI =
                    from p in basedados.Evento
                    where p.NrEvento == Iidevento.Value
                    select p.IdadeInferior;

                var idadeS =
                    from p in basedados.Evento
                    where p.NrEvento == Iidevento.Value
                    select p.IdadeSuperior;

                var IDADE =
                    from p in basedados.Pessoa.OfType <Filho>()
                    where p.IdPessoa == Iidfilho.Value
                    select p.DataNascimento;

                var nparticipantesmax =
                    from p in basedados.Evento
                    where p.NrEvento == Iidevento.Value
                    select p.LimiteParticipantes;

                var participantesInscritos =
                    from p in basedados.Inscricao
                    where p.EventosNrEvento == Iidevento.Value
                    select p;

                int idadeFilho = DateTime.Now.Year - IDADE.Single().Year;
                if (DateTime.Now.DayOfYear < IDADE.Single().DayOfYear)
                {
                    idadeFilho = idadeFilho - 1;
                }

                if (idadeI.First() <= idadeFilho && idadeS.Single() >= idadeFilho)
                {
                    if (participantesInscritos.Count() < nparticipantesmax.Single())
                    {
                        try
                        {
                            bool Iconfirmar = true;
                            inscricaoFilho.AddInscricao(Iconfirmar, Convert.ToInt32(Iidfilho.Value), Convert.ToInt32(Iidevento.Value));
                            Mostrar.DataSource = inscricaoFilho.GetInscricao();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                    }
                    else
                    {
                        MessageBox.Show("O Evento encontra se cheio");
                    }
                }
                else
                {
                    MessageBox.Show("O Filho não tem idade para participar no Evento");
                }

                Iidfilho.Value  = 0;
                Iidevento.Value = 0;
            }
            if (QualAdicionar == "participacao")
            {
                try
                {
                    participacaoEscola.AddParticipacao(Convert.ToInt32(PidEscola.Value), Convert.ToInt32(PidEvento.Value));
                    Mostrar.DataSource = participacaoEscola.GetParticipacao();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                PidEscola.Value = 0;
                PidEvento.Value = 0;
            }
            if (QualAdicionar == "colaboracao")
            {
                try
                {
                    colaboracao.AddColaboracao(Convert.ToInt32(CidEvento.Value), Convert.ToInt32(CidAnimador.Value));
                    Mostrar.DataSource = colaboracao.GetColaboracao();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                CidAnimador.Value = 0;
                CidEvento.Value   = 0;
            }
        }
Example #7
0
 public Avion(bool vuelosInternacionales, Etipo tipo, ECombustible combustible, int cantPasajeros) : base(tipo, combustible, cantPasajeros)
 {
     this.vuelosInternacionales = vuelosInternacionales;
 }
 public Transporte(Etipo tipo, ECombustible combustible, int pasajeros)
 {
     this.tipo             = tipo;
     this.combustible      = combustible;
     this.cantMaxPasajeros = pasajeros;
 }
Example #9
0
 public tinta(ConsoleColor a, Etipo b) : this(a)
 {
     this.tipo = b;
 }
Example #10
0
 public tinta()
 {
     this.color = ConsoleColor.Blue;
     this.tipo  = Etipo.comun;
 }
Example #11
0
 public Manual(string titulo, float precio, string nombre, string apellido, Etipo tipo) : base(precio, titulo, nombre, apellido)
 {
     this._tipo = tipo;
 }