Esempio n. 1
0
        private void findButton_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=IMDB_DB;Integrated Security=True");
            SqlCommand    cmd;
            SqlDataReader dr;
            string        sqlString = "";

            con.Open();


            sqlString = "SELECT m_no,name FROM Movies WHERE name=@name";
            cmd       = new SqlCommand(sqlString, con);

            cmd.Parameters.AddWithValue("@name", searchTextBox.Text);
            dr = cmd.ExecuteReader();

            dr.Read();
            if (dr.HasRows)
            {
                DetailsMovieForm detailMovie = new DetailsMovieForm();
                detailMovie.gelenM_No = dr[0].ToString();
                detailMovie.gelenU_No = gelenU_No;
                detailMovie.ShowDialog();
            }
            else
            {
                MessageBox.Show("Aradığınız film bulunamadı.");
            }
            con.Close();
        }
Esempio n. 2
0
        private void coverPictureBox_Click(object sender, EventArgs e)
        {
            DetailsMovieForm detailMovie = new DetailsMovieForm();

            detailMovie.gelenM_No = comingSoonMovie[comingSoonCounter].getM_no();
            detailMovie.gelenU_No = user.getU_No();
            detailMovie.ShowDialog();
        }
Esempio n. 3
0
        private void knownForPictureBox4_Click(object sender, EventArgs e)
        {
            DetailsMovieForm detailMovie = new DetailsMovieForm();

            detailMovie.gelenM_No = knownForInformation[3, 2];
            detailMovie.gelenU_No = gelenU_No;
            this.Close();
            detailMovie.Show();
        }
Esempio n. 4
0
        private void movieCover_Click(object sender, EventArgs e)
        {
            string     m_no  = "";
            PictureBox ogren = sender as PictureBox;

            m_no = ogren.Name.Substring(0, ogren.Name.IndexOf("@"));
            DetailsMovieForm detailMovie = new DetailsMovieForm();

            detailMovie.gelenM_No = m_no;
            detailMovie.gelenU_No = user.getU_No();
            detailMovie.ShowDialog();
        }
Esempio n. 5
0
        private void nameLabel_Click(object sender, EventArgs e)
        {
            string m_no  = "";
            Label  ogren = sender as Label;

            m_no = ogren.Name.Substring(0, ogren.Name.IndexOf("@"));
            DetailsMovieForm detailMovie = new DetailsMovieForm();

            detailMovie.gelenM_No = m_no;
            detailMovie.gelenU_No = user.getU_No();
            detailMovie.ShowDialog();
        }
Esempio n. 6
0
        private void findButton_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=IMDB_DB;Integrated Security=True");
            SqlCommand    cmd;
            SqlDataReader dr;
            string        sqlString = "";

            con.Open();
            if (searchTypeComboBox.SelectedIndex == 1)
            {
                sqlString = "SELECT m_no,name FROM Movies WHERE name=@name";
                cmd       = new SqlCommand(sqlString, con);

                cmd.Parameters.AddWithValue("@name", searchTextBox.Text);
                dr = cmd.ExecuteReader();

                dr.Read();
                if (dr.HasRows)
                {
                    DetailsMovieForm detailMovie = new DetailsMovieForm();
                    detailMovie.gelenM_No = dr[0].ToString();
                    detailMovie.gelenU_No = user.getU_No();
                    detailMovie.ShowDialog();
                }
                else
                {
                    MessageBox.Show("Aradığınız film bulunamadı.");
                }
                con.Close();
            }
            else
            {
                sqlString = "SELECT h_no,name,l_name FROM Human WHERE name=@name AND l_name=@l_name";
                cmd       = new SqlCommand(sqlString, con);
                string name, lname;
                if (searchTextBox.TextLength < 3)
                {
                    MessageBox.Show("Lütfen aranacak kişinin isim ve soyadını giriniz.");
                }
                else
                {
                    int temp = searchTextBox.Text.IndexOf(" ");
                    name = searchTextBox.Text.Substring(0, temp);
                    temp++;
                    lname = searchTextBox.Text.Substring(temp, searchTextBox.Text.Length - temp);
                    cmd.Parameters.AddWithValue("@name", name);
                    cmd.Parameters.AddWithValue("@l_name", lname);
                    dr = cmd.ExecuteReader();

                    dr.Read();
                    if (dr.HasRows)
                    {
                        DetailsHumanForm detailHuman = new DetailsHumanForm();
                        detailHuman.gelenH_No = dr[0].ToString();
                        detailHuman.gelenU_No = user.getU_No();
                        detailHuman.ShowDialog();
                    }
                    else
                    {
                        MessageBox.Show("Aradığınız kişi bulunamadı.");
                    }
                    con.Close();
                }
            }
        }