Пример #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (listBox1.SelectedIndex > -1)
     {
         if (searchC == 0)
         {
             UserSearchAnimes a = new UserSearchAnimes(listBox1.SelectedValue.ToString());
             this.Hide();
             a.ShowDialog();
             this.Show();
         }
         else if (searchC == 1)
         {
             UserSearchMangas a = new UserSearchMangas(listBox1.SelectedValue.ToString());
             this.Hide();
             a.ShowDialog();
             this.Show();
         }
         else if (searchC == 4)
         {
             UserSearchPublishers a = new UserSearchPublishers(listBox1.SelectedValue.ToString());
             this.Hide();
             a.ShowDialog();
             this.Show();
         }
         else if (searchC == 5)
         {
             UserSearchStudio a = new UserSearchStudio(listBox1.SelectedValue.ToString());
             this.Hide();
             a.ShowDialog();
             this.Show();
         }
         else if (searchC == 2)
         {
             UserSearchCharacters a = new UserSearchCharacters(listBox1.SelectedValue.ToString());
             this.Hide();
             a.ShowDialog();
             this.Show();
         }
         else if (searchC == 3)
         {
             UserSearchStaff a = new UserSearchStaff(listBox1.SelectedValue.ToString());
             this.Hide();
             a.ShowDialog();
             this.Show();
         }
     }
 }
Пример #2
0
        private void anime_list_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            MessageBox.Show(anime_list.SelectedRows[0].Cells[0].Value.ToString());
            UserSearchAnimes a = new UserSearchAnimes(anime_list.SelectedRows[0].Cells[0].Value.ToString());

            this.Hide();
            a.ShowDialog();
            this.Show();
            DbConnection db  = new DbConnection();
            DataTable    ans = db.Select("select wa.Anime_ID, (select [Name] from Animes where Anime_ID = wa.Anime_ID) as [Name]," +
                                         "wa.Status, wa.Rating, wa.Favourite from Watched_Animes as wa where wa.User_Name = '" + User.userName + "' order by [name]");

            anime_list.DataSource         = ans;
            anime_list.Columns[0].Visible = false;
            anime_list.ReadOnly           = true;
        }