Exemple #1
0
 private void EditArticleWithID(string _id)
 {
     try
     {
         int         id       = Convert.ToInt32(_id);
         ArticleFile existArt = Program.currentProject.FindArticleWithID(id);
         // find all additional data for the given announcement id
         Dictionary <string, ArticleFile> nonEngData = Program.currentProject.ReadArticleNonEnglishData(id);
         frmAddArticle existArtDlg = new frmAddArticle(existArt, false, nonEngData);
         existArtDlg.Text = "Edit Article";
         if (existArtDlg.ShowDialog(this) == DialogResult.OK)
         {
             if (existArtDlg.nonEngAdditionalData.Count > 0)
             {
                 Program.currentProject.SaveArticlesNonEnglishData(existArtDlg.nonEngAdditionalData);
             }
             this.ApplyChangesOnHardDrive();
         }
         this.UpdateTreesPresentation();
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }
Exemple #2
0
 private void btnAddArticle_Click(object sender, EventArgs e)
 {
     try
     {
         int           id         = Program.currentProject.FindLastArticleID();
         ArticleFile   newArticle = new ArticleFile(id);
         frmAddArticle newArtDlg  = new frmAddArticle(newArticle, true, null);
         newArtDlg.Text = "Add Article";
         if (newArtDlg.ShowDialog(this) == DialogResult.OK)
         {
             //newPlaylist.id = Program.currentProject.FindLastPlaylistID();
             Program.currentProject.AddArticle(newArticle);
             if (newArtDlg.nonEngAdditionalData.Count > 0)
             {
                 Program.currentProject.SaveArticlesNonEnglishData(newArtDlg.nonEngAdditionalData);
             }
             this.ApplyChangesOnHardDrive();
         }
         this.UpdateTreesPresentation();
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }