private void ToolStripMenuItem_DelArticle_Click(object sender, EventArgs e)
 {
     if (lv_ArticleTitleList.SelectedIndices.Count>0)
     {
         using (ArticleDAL dal = new ArticleDAL ())
         {
             Article article =
                 ArticleList.Where(a => a.ID ==
                 Guid.Parse(lv_ArticleTitleList.SelectedItems[0].Name)).First();
             if (dal.DelArticle(article))
             {
                 Bind();
                 MessageBox.Show("删除成功");
             }
             else
             {
                 MessageBox.Show("删除失败");
             }
         }
     }
 }
        private void btn_Save_Click(object sender, EventArgs e)
        {
            if (lv_ArticleTitleList.CheckedItems.Count<=0)
            {
                MessageBox.Show("没有勾选需要的文章,请勾选");
                return;
            }

            using (ArticleDAL dal = new ArticleDAL ())
            {
                for (int i = 0; i < lv_ArticleTitleList.CheckedItems.Count; i++)
                {
                    Article article =
                        articleList.Where(
                            a => a.ID == Guid.Parse(
                                lv_ArticleTitleList.CheckedItems[i].Name
                                )).FirstOrDefault();

                    using (PicProcess pic = new PicProcess ())
                    {
                        if (pic.Process(article))
                        {
                            dal.AddArticle(article);
                        }
                        else
                        {
                            MessageBox.Show("上传失败");
                            return;
                        }
                    }
                }
            }
            mainForm.Bind();
            MessageBox.Show("保存成功!");
        }
        private void ToolStripMenuItem_UpdateArticle_Click(object sender, EventArgs e)
        {
            if (lv_ArticleTitleList.SelectedIndices.Count>0)
            {
                Article article = ArticleList.Where(a => a.ID ==
                Guid.Parse(lv_ArticleTitleList.SelectedItems[0].Name)).First();

                NewCollectForm form = new NewCollectForm(ref article);
                form.ShowDialog();

                using (ArticleDAL dal = new ArticleDAL ())
                {
                    if (dal.UpdateArticle(article))
                    {
                        Bind();
                    }
                }
            }
        }