private void DisplayManagementPack(ManagementPackPreviewItem item)
        {
            _SelectedItem = item;
            Cursor        = Cursors.WaitCursor;
            try
            {
                Application.DoEvents();

                using (var context = SqlDataHandler.GetDataContext())
                {
                    var dataItem = context.ManagementPackSet.Single(a => a.id == _SelectedItem.Id);
                    tbComments.Text = dataItem.Commments;

                    string tempPDFFile = "";

                    tempPDFFile = Path.GetTempPath();
                    if (!tempPDFFile.EndsWith(@"\"))
                    {
                        tempPDFFile = tempPDFFile + @"\";
                    }

                    tempPDFFile = tempPDFFile + System.Guid.NewGuid().ToString("N") + ".pdf";
                    _SelectedItem.PDFFileName = tempPDFFile;
                    File.WriteAllBytes(_SelectedItem.PDFFileName, dataItem.ReportData);

                    DisplayPDF();
                }
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
 private void ClosePDF()
 {
     this.axAcroPDF1.Visible = false;
     File.Delete(_SelectedItem.PDFFileName);
     _SelectedItem.PDFFileName = "";
     tbComments.Text           = "";
     _SelectedItem             = null;
 }