Пример #1
0
 private void AgregarLocalButton_Click(object sender, EventArgs e)
 {
     VerLocalesPanel.Visible   = false;
     RevisarLocalPanel.Visible = false;
     if (AgregarLocalPanel.Visible)
     {
         AgregarLocalPanel.Visible = false;
     }
     else
     {
         AgregarLocalPanel.Visible = true;
     }
     NombreDueñoInput.ResetText();
     HoraAperturaInput.ResetText();
     HoraCierreInput.ResetText();
     TipodelocalcomboBox.SelectedIndex = 0;
     DefaultLabel.Visible      = false;
     DefaultLabel.Visible      = false;
     textBoxCrearlocal.Visible = false;
     textBoxCrearlocal.ResetText();
     IdTextbox.ResetText();
     VerificarLocalButton.Visible = false;
     HoraAperturaInput.Visible    = false;
     HoraAperturaLabel.Visible    = false;
     HoraCierreInput.Visible      = false;
     HoraCierreLabel.Visible      = false;
     CrearLocalDueñoLabel.Visible = false;
     NombreDueñoInput.Visible     = false;
     IdTextbox.Visible            = false;
     IdLabel.Visible = false;
     MesasExclusivasComboBox.Visible = false;
 }
Пример #2
0
        private void Tipodelocal_Click(object sender, EventArgs e)
        {
            VerificarLocalButton.Visible = true;
            HoraAperturaInput.Visible    = true;
            HoraAperturaLabel.Visible    = true;
            HoraCierreInput.Visible      = true;
            HoraCierreLabel.Visible      = true;
            CrearLocalDueñoLabel.Visible = true;
            NombreDueñoInput.Visible     = true;
            IdTextbox.Visible            = true;
            IdLabel.Visible = true;
            NombreDueñoInput.ResetText();
            HoraAperturaInput.ResetText();
            HoraCierreInput.ResetText();
            IdTextbox.ResetText();
            textBoxCrearlocal.ResetText();
            string localType = TipodelocalcomboBox.SelectedItem.ToString();

            if (localType == "Cine")
            {
                textBoxCrearlocal.ResetText();
                DefaultLabel.Text               = "Numero de salas";
                DefaultLabel.Visible            = true;
                textBoxCrearlocal.Visible       = true;
                MesasExclusivasComboBox.Visible = false;
            }
            if (localType == "Restaurante")
            {
                DefaultLabel.Visible                  = false;
                MesasExclusivasComboBox.Visible       = true;
                MesasExclusivasComboBox.SelectedIndex = 0;
                textBoxCrearlocal.Visible             = false;
                textBoxCrearlocal.ResetText();
            }
            if (localType == "Tienda")
            {
                textBoxCrearlocal.ResetText();
                DefaultLabel.Text               = "Ingrse la Categoria";
                DefaultLabel.Visible            = true;
                textBoxCrearlocal.Visible       = true;
                MesasExclusivasComboBox.Visible = false;
            }
            if (localType == "Recreacional")
            {
                DefaultLabel.Visible            = false;
                textBoxCrearlocal.Visible       = false;
                MesasExclusivasComboBox.Visible = false;
            }
        }
Пример #3
0
        private void CrearLocalButton_Click(object sender, EventArgs e)
        {
            bool   idnotexist      = true;
            string exclusiveTables = "";
            string textbox         = "";
            string attentionHour;
            string ownerName  = NombreDueñoInput.Text;
            string openHouse  = HoraAperturaInput.Text;
            string closehouse = HoraCierreInput.Text;
            string id         = IdTextbox.Text;

            if (id.Length < 8)
            {
                MessageBox.Show("ID debe tener 8 caracteres");
                idnotexist = false;
            }
            else
            {
                foreach (string i in idList)
                {
                    if (id == i)
                    {
                        MessageBox.Show("Este Id ya existe");
                        idnotexist = false;
                    }
                }
            }
            if (idnotexist)
            {
                idList.Add(id);
            }
            attentionHour = openHouse + "-" + closehouse;
            string localType = TipodelocalcomboBox.SelectedItem.ToString();

            if (localType == "Restaurante")
            {
                exclusiveTables = MesasExclusivasComboBox.SelectedItem.ToString();
            }
            if (localType == "Cine" || localType == "Tienda")
            {
                textbox = textBoxCrearlocal.Text;
            }
            if (ownerName == "" || openHouse == "" || closehouse == "" || localType == "---Selecione un tipo---" || id == "")
            {
                MessageBox.Show("Debe rellenar todos los campos");
            }
            else
            {
                if (idnotexist)
                {
                    if (localType == "Cine")
                    {
                        textBoxCrearlocal.ResetText();
                        DefaultLabel.Text               = "Numero de salas";
                        DefaultLabel.Visible            = true;
                        textBoxCrearlocal.Visible       = true;
                        MesasExclusivasComboBox.Visible = false;
                        if (CreatCine != null)
                        {
                            CreatCine(this, new CreatCinemaEventArgs()
                            {
                                OnwerNameText = ownerName, IdText = id, AttentionHour1Text = attentionHour, NRooms = textbox
                            });
                        }
                    }
                    if (localType == "Restaurante")
                    {
                        DefaultLabel.Visible                  = false;
                        MesasExclusivasComboBox.Visible       = true;
                        MesasExclusivasComboBox.SelectedIndex = 0;
                        textBoxCrearlocal.Visible             = false;
                        textBoxCrearlocal.ResetText();
                        if (CreatRestaurant != null)
                        {
                            CreatRestaurant(this, new CreatRestaurantEventArgs()
                            {
                                OnwerNameText = ownerName, IdText = id, AttentionHour1Text = attentionHour, ExclusiveTables = exclusiveTables
                            });
                        }
                    }
                    if (localType == "Tienda")
                    {
                        textBoxCrearlocal.ResetText();
                        DefaultLabel.Text               = "Ingrse la Categoria";
                        DefaultLabel.Visible            = true;
                        textBoxCrearlocal.Visible       = true;
                        MesasExclusivasComboBox.Visible = false;
                        string categories = textBoxCrearlocal.Text;
                        if (CreatStore != null)
                        {
                            CreatStore(this, new CreatStoreEventArgs()
                            {
                                OnwerNameText = ownerName, IdText = id, AttentionHour1Text = attentionHour, CategoriesText = textbox
                            });
                        }
                    }
                    if (localType == "Recreacional")
                    {
                        if (CreatRecreatinal != null)
                        {
                            CreatRecreatinal(this, new CreatRecreationalEventArgs()
                            {
                                OnwerNameText = ownerName, IdText = id, AttentionHour1Text = attentionHour
                            });
                        }
                    }
                    NombreDueñoInput.ResetText();
                    HoraAperturaInput.ResetText();
                    HoraCierreInput.ResetText();
                    IdTextbox.ResetText();
                    textBoxCrearlocal.ResetText();
                    textBoxCrearlocal.ResetText();
                    TipodelocalcomboBox.SelectedIndex = 0;
                    VerificarLocalButton.Visible      = false;
                    HoraAperturaInput.Visible         = false;
                    HoraAperturaLabel.Visible         = false;
                    HoraCierreInput.Visible           = false;
                    HoraCierreLabel.Visible           = false;
                    CrearLocalDueñoLabel.Visible      = false;
                    NombreDueñoInput.Visible          = false;
                    IdTextbox.Visible = false;
                    IdLabel.Visible   = false;
                    MesasExclusivasComboBox.Visible = false;
                    textBoxCrearlocal.Visible       = false;
                    DefaultLabel.Visible            = false;
                }
            }
        }