예제 #1
0
 private void EditAnnounceWithID(string _id)
 {
     try
     {
         int id = Convert.ToInt32(_id);
         // find current announcement in memory
         MovieFile existAnn = Program.currentProject.FindAnnouncWithID(id);
         // find all additional data for the given announcement id
         Dictionary <string, MovieFile> nonEngData = Program.currentProject.ReadAnnouncNonEnglishData(id);
         frmAddMovie existAnnDlg = new frmAddMovie(existAnn, false, nonEngData);
         existAnnDlg.Text = "Edit Announcement";
         if (existAnnDlg.ShowDialog(this) == DialogResult.OK)
         {
             if (existAnnDlg.nonEngAdditionalData.Count > 0)
             {
                 Program.currentProject.SaveAnnouncesNonEnglishData(existAnnDlg.nonEngAdditionalData);
             }
             this.ApplyChangesOnHardDrive();;
         }
         this.UpdateTreesPresentation();
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }
예제 #2
0
 private void btnAddMovie_Click(object sender, EventArgs e)
 {
     try
     {
         int         id        = Program.currentProject.FindLastMovieID();
         MovieFile   newMovie  = new MovieFile(id);
         frmAddMovie newMovDlg = new frmAddMovie(newMovie, true, null);
         if (newMovDlg.ShowDialog(this) == DialogResult.OK)
         {
             Program.currentProject.AddMovie(newMovie);
             if (newMovDlg.nonEngAdditionalData.Count > 0)
             {
                 Program.currentProject.SaveMoviesNonEnglishData(newMovDlg.nonEngAdditionalData);
             }
             this.ApplyChangesOnHardDrive();
         }
         this.UpdateTreesPresentation();
     }
     catch (Exception exp)
     {
         Program.ShowExceptionData(exp);
     }
 }