private void AgregarBtn_Click(object sender, EventArgs e)
 {
     if (TipoLocalBox.Text == "Cine")
     {
         Cine cine = new Cine(textBox5.Text, textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text);
         cines.Add(cine);
     }
     else if (TipoLocalBox.Text == "Recreacional")
     {
         Recreacional recreacional = new Recreacional(textBox5.Text, textBox1.Text, textBox2.Text, textBox3.Text);
         recreacionales.Add(recreacional);
     }
     else if (TipoLocalBox.Text == "Restaurante")
     {
         Restaurante restaurante = new Restaurante(textBox5.Text, textBox1.Text, textBox2.Text, textBox3.Text, RestauranteComboBox.Text);
         restaurantes.Add(restaurante);
     }
     else if (TipoLocalBox.Text == "Tienda")
     {
         Tienda tienda = new Tienda(textBox5.Text, textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text);
         tiendas.Add(tienda);
     }
     textBox1.Clear();
     textBox2.Clear();
     textBox3.Clear();
     textBox4.Clear();
     textBox5.Clear();
     RestauranteComboBox.Text = "";
 }
Пример #2
0
        private void buttonCrear_Click(object sender, EventArgs e)
        {
            string mensaje = " ";

            if (comboBox1.Text == "Cine")
            {
                Cine cine = new Cine(textBoxNd.Text, Int32.Parse(textBoxId.Text), textBoxH.Text, Int32.Parse(textBoxNSalas.Text));
                mensaje = "Cine " + textBoxNd.Text + " creado con exito";
                Global.localesComerciales.Add(cine);
                comboBoxLocales.Items.Add(cine.OwnerName);
            }
            else if (comboBox1.Text == "Restaurant")
            {
                Restaurante restaurante = new Restaurante(textBoxNd.Text, Int32.Parse(textBoxH.Text), textBoxH.Text, checkBoxEx.Checked);
                mensaje = "Restaurante " + restaurante.OwnerName + " creado con exito";
                Global.localesComerciales.Add(restaurante);
                comboBoxLocales.Items.Add(restaurante.OwnerName);
            }
            else if (comboBox1.Text == "Tienda")
            {
                Tienda tienda = new Tienda(textBoxNd.Text, Int32.Parse(textBoxH.Text), textBoxH.Text);
                tienda.categorias.Add(textBoxNSalas.Text);
                mensaje = "Tienda " + tienda.OwnerName + " creadoa con exito";
                Global.localesComerciales.Add(tienda);
                comboBoxLocales.Items.Add(tienda.OwnerName);
            }
            else if (comboBox1.Text == "Recreacional")
            {
                Recreacional recreacional = new Recreacional(textBoxNd.Text, Int32.Parse(textBoxH.Text), textBoxH.Text);
                mensaje = "Recreacional " + recreacional.OwnerName + " creadoa con exito";
                Global.localesComerciales.Add(recreacional);
                comboBoxLocales.Items.Add(recreacional.OwnerName);
            }
            MessageBox.Show(mensaje);
        }
        public bool OnCheckRecreacion(object sender, AddRecreacionEventArgs e)
        {
            int count = 0;

            foreach (Local l in locals)
            {
                if (l.Identifier == e.Identifier)
                {
                    count++;
                }
            }
            if (count == 0)
            {
                Recreacional r = new Recreacional(e.OwnerName, e.Identifier, e.AttentionTime);
                locals.Add(r);
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public void Initialize()
        {
            Restaurante r1 = new Restaurante("Kika", 1, "12:00-19:00", false);

            locals.Add(r1);
            Restaurante r2 = new Restaurante("Juan", 2, "10:00-22:00", true);

            locals.Add(r2);
            Restaurante r3 = new Restaurante("Isabel", 3, "8:00-13:00", false);

            locals.Add(r3);
            Cine c = new Cine("Francisco", 4, "10:00-24:00", 10);

            locals.Add(c);
            List <string> l = new List <string>()
            {
                "Juguetes", "Ropa niño"
            };
            Tienda t1 = new Tienda("José", 5, "10:00-22:00", l);

            locals.Add(t1);
            List <string> a = new List <string>()
            {
                "Mujer", "Accesorios", "Cosméticos"
            };
            Tienda t2 = new Tienda("María", 6, "10:00-22:00", a);

            locals.Add(t2);
            List <string> d = new List <string>()
            {
                "Comida sana"
            };
            Tienda t3 = new Tienda("Diego", 7, "10:00-22:00", d);

            locals.Add(t3);
            Recreacional r = new Recreacional("Antonia", 8, "11:00-20:00");

            locals.Add(r);
        }
        private void button4_Click_1(object sender, EventArgs e)
        {
            string nombreloc = NomTextBox2.Text;

            NomTextBox2.Clear();
            IDTextBox2.Clear();
            DueñoTextbox2.Clear();
            HorarioTextbox2.Clear();
            textboxcineytiendayrestaurante2.Clear();

            if (comboBox2.Text == "Cine")
            {
                try
                {
                    Cine asd = cines.Where(cine => cine.nombre == nombreloc).FirstOrDefault();
                    if (asd == null)
                    {
                        NomTextBox2.Text = "No Existe";
                    }
                    else
                    {
                        NomTextBox2.Text     = asd.nombre;
                        DueñoTextbox2.Text   = asd.dueño;
                        IDTextBox2.Text      = asd.id;
                        HorarioTextbox2.Text = asd.horario;
                        textboxcineytiendayrestaurante2.Text = asd.nSalas;
                    }
                }
                catch
                {
                    NomTextBox2.Text = "No Existe";
                }
            }
            else if (comboBox2.Text == "Recreacional")
            {
                try
                {
                    Recreacional asd = recreacionales.Where(recreacional => recreacional.nombre == nombreloc).FirstOrDefault();
                    if (asd == null)
                    {
                        NomTextBox2.Text = "No Existe";
                    }
                    else
                    {
                        DueñoTextbox2.Text   = asd.dueño;
                        IDTextBox2.Text      = asd.id;
                        HorarioTextbox2.Text = asd.horario;
                    }
                }
                catch
                {
                    NomTextBox2.Text = "No Existe";
                }
            }
            else if (comboBox2.Text == "Restaurante")
            {
                try
                {
                    Restaurante asd = restaurantes.Where(restaurante => restaurante.nombre == nombreloc).FirstOrDefault();
                    if (asd == null)
                    {
                        NomTextBox2.Text = "No Existe";
                    }
                    else
                    {
                        DueñoTextbox2.Text   = asd.dueño;
                        IDTextBox2.Text      = asd.id;
                        HorarioTextbox2.Text = asd.horario;
                        textboxcineytiendayrestaurante2.Text = asd.mesasExclusivas;
                    }
                }
                catch
                {
                    NomTextBox2.Text = "No Existe";
                }
            }
            else if (comboBox2.Text == "Tienda")
            {
                try
                {
                    Tienda asd = tiendas.Where(tienda => tienda.nombre == nombreloc).FirstOrDefault();
                    if (asd == null)
                    {
                        NomTextBox2.Text = "No Existe";
                    }
                    else
                    {
                        DueñoTextbox2.Text   = asd.dueño;
                        IDTextBox2.Text      = asd.id;
                        HorarioTextbox2.Text = asd.horario;
                        textboxcineytiendayrestaurante2.Text = asd.categorias;
                    }
                }
                catch
                {
                    NomTextBox2.Text = "No Existe";
                }
            }
        }