Esempio n. 1
0
        private void BtnUpdateNum_Click(object sender, EventArgs e)
        {
            TblNumDal dal  = new TblNumDal();
            int       rows = dal.InsertToTblNum();

            MessageBox.Show("共计添加了" + rows.ToString() + "番号数据。");
        }
Esempio n. 2
0
        /// <summary>
        /// 增加Genre类别到NFO文件中。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnAddGenre_Click(object sender, EventArgs e)
        {
            if (this.cbGenre.Text.Length > 0)
            {
                string[] dirs = Directory.GetFiles(currentFilePath, "*.nfo");
                FuncNFO  nfo  = new FuncNFO();
                //bool boolGenreQuality=false;

                if (dirs.Length > 0)
                {
                    List <string> lsTags = nfo.GetTags(dirs[0]);
                    //string zh=  lsTags.Where(s => s.Substring(2, 4) == "中文字幕").FirstOrDefault();
                    //string gq = lsTags.Where(s => s.Substring(2, 2) == "高清").FirstOrDefault();

                    //判断某字符串在集合中是否存在,存在就跳出。
                    foreach (string item in lsTags)
                    {
                        if ("Ge" + this.cbGenre.Text == item)
                        {
                            return;
                        }

                        //if (this.cbGenre.Text.Contains("清") && item.Contains("清"))
                        //{
                        //    boolGenreQuality = true;
                        //}
                    }


                    //更新到数据库中。
                    TblNumDal numDal = new TblNumDal();
                    numDal.UpdateGenre(this.cbGenre.Text, _numID);
                    //重新加载。
                    ViMovieNumDal vi = new ViMovieNumDal();
                    LoadData(vi.Select("select * from viMovieNum"));


                    //添加到NFO文件中。
                    foreach (string item in dirs)
                    {
                        nfo.AddGenre(item, this.cbGenre.Text);
                    }



                    MessageBox.Show("添加成功。");
                }
                else
                {
                    MessageBox.Show("未找到有效的NFO文件。");
                }
            }
            else
            {
                MessageBox.Show("Genre不能为空值。");
            }
        }