Пример #1
0
        private void dothesearch()
        {
            if (txtBoxSearchSyllogo.Text != "")
            {
                SullogosAnazitisis = null;
                this.syllogoiTableAdapter.Fill(ptuxiakiDatabaseDataSet1.Syllogoi);
                DataRow[] grammes;
                int count_results;
                int idSullogou;
                bool is_int = int.TryParse(txtBoxSearchSyllogo.Text, out idSullogou);
                if (is_int)
                {
                    grammes = ptuxiakiDatabaseDataSet1.Tables["Syllogoi"].Select("ID_Syllogou ='" + txtBoxSearchSyllogo.Text + "'");
                }
                else
                {
                    txtBoxSearchSyllogo.Text = txtBoxSearchSyllogo.Text.Replace('*', '%');
                    grammes = ptuxiakiDatabaseDataSet1.Tables["Syllogoi"].Select("Onoma_Syllogou LIKE '" + txtBoxSearchSyllogo.Text + "' or Eponumo_Proedrou LIKE '" + txtBoxSearchSyllogo.Text + "'");
                }
                count_results = grammes.Length;
                if (count_results > 1)
                {
                    stoixeio = txtBoxSearchSyllogo.Text;
                   FormEpilogiSyllogou SyllogosEpilogi_Show_A = new FormEpilogiSyllogou();
                   SyllogosEpilogi_Show_A.stoixeio = stoixeio;
                    if (SyllogosEpilogi_Show_A.ShowDialog() == DialogResult.OK)
                    {
                        SullogosAnazitisis = SyllogosEpilogi_Show_A.SullogosAnazitisis;
                        iD_SyllogouLabel1.Text = SullogosAnazitisis[0].ToString();
                        onoma_SyllogouLabel1.Text = SullogosAnazitisis[1].ToString();
                        onoma_ProedrouLabel1.Text = SullogosAnazitisis[2].ToString();
                        eponumo_ProedrouLabel1.Text = SullogosAnazitisis[3].ToString();
                        num_FialesLabel1.Text = SullogosAnazitisis[4].ToString();
                        date_IdrisisLabel1.Text = SullogosAnazitisis[5].ToString();

                    }

                }
                if (count_results == 1)
                {
                    SullogosAnazitisis = grammes[0];
                    iD_SyllogouLabel1.Text = SullogosAnazitisis[0].ToString();
                    onoma_SyllogouLabel1.Text = SullogosAnazitisis[1].ToString();
                    onoma_ProedrouLabel1.Text = SullogosAnazitisis[2].ToString();
                    eponumo_ProedrouLabel1.Text = SullogosAnazitisis[3].ToString();
                    num_FialesLabel1.Text = SullogosAnazitisis[4].ToString();
                    date_IdrisisLabel1.Text = SullogosAnazitisis[5].ToString();
                }
                if (count_results == 0)
                {
                    MessageBox.Show("Δεν βρέθηκε η εγγραφή!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                     txtBoxSearchSyllogo.Focus();
                     txtBoxSearchSyllogo.SelectAll();
                }

            }
        }
Пример #2
0
        private void SearchSyllogo()
        {
            if (textBoxSearchSyllogo.Text != "")
            {
                SyllogosAnazitisis = null;
                this.syllogoiTableAdapter1.Fill(ptuxiakiDatabaseDataSet11.Syllogoi);
                DataRow[] grammes;
                int count_results = 0;
                int idSyllogou;
                bool idgiven = int.TryParse(textBoxSearchSyllogo.Text, out idSyllogou);
                if (idgiven)
                {
                    grammes = ptuxiakiDatabaseDataSet11.Tables["Syllogoi"].Select("ID_Syllogou='" + textBoxSearchSyllogo.Text + "'");
                    count_results = grammes.Length;
                    if (count_results != 0)
                    {
                        SyllogosAnazitisis = grammes[0];
                    }
                    else
                    {
                        MessageBox.Show("Δεν βρέθηκε ο Σύλλογος!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                else
                {
                    textBoxSearchSyllogo.Text = textBoxSearchSyllogo.Text.Replace('*', '%');
                    grammes = ptuxiakiDatabaseDataSet11.Tables["Syllogoi"].Select("Onoma_Syllogou LIKE '" + textBoxSearchSyllogo.Text + "' or Eponumo_Proedrou LIKE '" + textBoxSearchSyllogo.Text + "'");
                    count_results = grammes.Length;

                    if (count_results > 1)
                    {
                        stoixeio = textBoxSearchSyllogo.Text;
                        FormEpilogiSyllogou epilogisyllogou = new FormEpilogiSyllogou();
                        epilogisyllogou.stoixeio = stoixeio;
                        if (epilogisyllogou.ShowDialog() == DialogResult.OK)
                        {
                            SyllogosAnazitisis = epilogisyllogou.SullogosAnazitisis;
                        }
                    }
                    if (count_results == 1)
                    {
                        SyllogosAnazitisis = grammes[0];
                    }
                    if (count_results == 0)
                    {
                        MessageBox.Show("Δεν βρέθηκε ο Συλλόγος!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }

                }

            }
        }
Пример #3
0
        private void dothesearchSyllogou()
        {
            if (textBoxSearchSyllogo.Text != "")
            {
                int results = 0;
                DataRow[] grammesSyllogou;
                this.syllogoiTableAdapter1.Fill(ptuxiakiDatabaseDataSet11.Syllogoi);
                int idSyllogou;
                bool is_int = int.TryParse(textBoxSearchSyllogo.Text, out idSyllogou);
                if (is_int)
                {
                    grammesSyllogou = ptuxiakiDatabaseDataSet11.Tables["Syllogoi"].Select("ID_Syllogou= '" + textBoxSearchSyllogo.Text + "'");
                }
                else
                {
                    textBoxSearchSyllogo.Text = textBoxSearchSyllogo.Text.Replace('*', '%');
                    grammesSyllogou = ptuxiakiDatabaseDataSet11.Tables["Syllogoi"].Select("Onoma_Syllogou LIKE '" + textBoxSearchSyllogo.Text + "'or Eponumo_Proedrou LIKE '" + textBoxSearchSyllogo.Text + "'");
                }
                results = grammesSyllogou.Length;
                if (results > 1)
                {
                    stoixeioSyllogou = textBoxSearchSyllogo.Text;
                    FormEpilogiSyllogou SyllogosEpilogi = new FormEpilogiSyllogou();
                    SyllogosEpilogi.stoixeio = stoixeioSyllogou;
                    if (SyllogosEpilogi.ShowDialog() == DialogResult.OK)
                    {
                        SullogosAnazitisis = SyllogosEpilogi.SullogosAnazitisis;
                        FormFindSyllogoFromMain SullogosEpilogi_Show_A = new FormFindSyllogoFromMain();
                        SullogosEpilogi_Show_A.SullogosAnazitisis = SullogosAnazitisis;
                        SullogosEpilogi_Show_A.Show();
                    }
                }

                if (results == 1)
                {
                    MessageBox.Show("Ο Σύλλογος βρέθηκε", "Found !", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    FormFindSyllogoFromMain findSullogos = new FormFindSyllogoFromMain();
                    findSullogos.SullogosAnazitisis = grammesSyllogou[0];
                    findSullogos.Show();
                }

                if (results == 0)
                {
                    MessageBox.Show("Δεν βρέθηκε ο Σύλλογος!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }

            }
        }