コード例 #1
0
ファイル: Form1.cs プロジェクト: starik222/AnimeManager
        private void изменитьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form_add f_add = new Form_add();
            f_add.Owner = this;
            Form_add.anim_inf a_i = new Form_add.anim_inf();
            string ser = ((ListView)listView1).SelectedItems[0].SubItems[1].Text;
            string name = ((ListView)listView1).SelectedItems[0].Text;
            DataTable dt_anim = GetInfoAnime(name, ser);
            MemoryStream ms = new MemoryStream();
            Image image = null;
            byte[] Img = (byte[])dt_anim.Rows[0]["img"];

            if (pictureBox1.Image != null)
                pictureBox1.Image = null;
            ms = new MemoryStream(Img, true);
            image = Image.FromStream(ms);
            //pictureBox1.Load(str);
            a_i.name_a = dt_anim.Rows[0]["name"].ToString();
            a_i.zhanr = dt_anim.Rows[0]["Zhanr"].ToString();
            // = dt_anim.Rows[0]["season"].ToString();
            a_i.tip = dt_anim.Rows[0]["series"].ToString();
            a_i.opisanie = dt_anim.Rows[0]["opisanie"].ToString();
            a_i.god = dt_anim.Rows[0]["god"].ToString();
            a_i.zhanr = a_i.zhanr.Replace(", ", "|");
            f_add.a_i = a_i;
            f_add.sezon = dt_anim.Rows[0]["season"].ToString();
            //f_add.pict = str;
            f_add.img_stream = image;
            f_add.edit = true;
            DataTable dt_files = GetFilesList(name, ser);
            Files_List[] f_list = new Files_List[dt_files.Rows.Count];
            for (int i = 0; i < dt_files.Rows.Count; i++)
            {
                f_list[i].name_s = dt_files.Rows[i]["name_s"].ToString();
                f_list[i].path_s = dt_files.Rows[i]["path_s"].ToString();
                f_list[i].nomer_s = dt_files.Rows[i]["nomer_s"].ToString();
            }
            FileInfo[] f_i = new FileInfo[f_list.Length];
            for (int i = 0; i < f_i.Length; i++)
            {
                f_i[i] = new FileInfo(f_list[i].path_s);
            }
            f_add.f_i = f_i;
            f_add.ShowDialog();
        }
コード例 #2
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if ((e.ColumnIndex == 3) && (e.RowIndex != -1))
     {
         dataGridView1.Rows.RemoveAt(e.RowIndex);
     }
     if ((e.ColumnIndex == 2) && (e.RowIndex != -1))
     {
         Form_add f_add = new Form_add();
         f_add.Owner = this;
         if (!roditel)
             f_add.name_anime = (string)dataGridView1.Rows[e.RowIndex].Cells["name"].Value;
         else
             f_add.name_anime = rod_cat;
         f_add.directory = (string)dataGridView1.Rows[e.RowIndex].Cells["fullPath"].Value;
         f_add.From_all = true;
         f_add.auto = false;
         f_add.next = false;
         f_add.ShowDialog();
         if (progress)
         {
             dataGridView1.Rows[e.RowIndex].Cells["Prog"].Value = "Да";
             dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Green;
             progress = false;
         }
     }
     if ((e.ColumnIndex == 5) && (e.RowIndex != -1))
     {
         Form_add_all_catalog f_a = new Form_add_all_catalog();
         f_a.Owner = this;
         f_a.button1.Visible = false;
         f_a.Width = 1069;
         f_a.AddToList((string)dataGridView1.Rows[e.RowIndex].Cells["fullPath"].Value);
         f_a.rod_cat = (string)dataGridView1.Rows[e.RowIndex].Cells["name"].Value;
         f_a.roditel = true;
         f_a.ShowDialog();
     }
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: starik222/AnimeManager
 private void добавитьToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Form_add f_add = new Form_add();
     f_add.Owner = this;
     f_add.ShowDialog();
 }
コード例 #4
0
 private void button2_Click(object sender, EventArgs e)
 {
     for(int i=0;i<dataGridView1.Rows.Count;i++)
     {
         if (dataGridView1.Rows[i].Cells["Prog"].Value == "Да")
             continue;
         Form_add f_add = new Form_add();
         f_add.Owner = this;
         if (!roditel)
             f_add.name_anime = (string)dataGridView1.Rows[i].Cells["name"].Value;
         else
             f_add.name_anime = rod_cat;
         f_add.directory = (string)dataGridView1.Rows[i].Cells["fullPath"].Value;
         f_add.From_all = true;
         f_add.auto = true;
         f_add.next = true;
         f_add.ShowDialog();
         if (progress)
         {
             dataGridView1.Rows[i].Cells["Prog"].Value = "Да";
             dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.Green;
             progress = false;
         }
     }
 }