Пример #1
0
        private void buttonSearch_Click(object sender, EventArgs e)
        {
            if (textBoxSearch.Text != "")
            {
                string         validationData;
                GestionArchivo gs = new GestionArchivo(Cliente.path);
                gs.PathTemp = PathTemp;

                int position = getPosition(Titles, SearchFor);

                validationData = gs.SearchData(textBoxSearch.Text, position);
                if (validationData != null)
                {
                    data = validationData;
                    MessageInfoAlert.ForeColor = Color.Green;
                    MessageInfoAlert.Text      = "¡Busqueda exitosa!";
                }
                else
                {
                    data = null;
                    MessageInfoAlert.ForeColor = Color.Red;
                    MessageInfoAlert.Text      = "¡No encontrado!";
                }
            }
            else
            {
                MessageInfoAlert.Text = "¡Campo vacio!";
            }
        }
Пример #2
0
        private void buttonSearch_Click_1(object sender, EventArgs e)
        {
            if (textBoxSearch.Text != "")
            {
                bool           validationData;
                GestionArchivo gs = new GestionArchivo(pathDataBase);
                gs.PathTemp = PathTemp;

                int position = getPosition(Titles, SearchFor);

                validationData = gs.SearchData(textBoxSearch.Text, position);
                if (validationData)
                {
                    MessageInfoAlert.ForeColor = Color.Green;
                    MessageInfoAlert.Text      = "¡Busqueda exitosa!";
                    panel.Controls.Clear();
                    ImprimirData(panel, PathTemp, Titles).Show();
                }
                else
                {
                    MessageInfoAlert.ForeColor = Color.Red;
                    MessageInfoAlert.Text      = "¡No encontrado!";
                }
            }
            else
            {
                MessageInfoAlert.Text = "¡Campo vacio!";
            }
        }