private void gridPrintoutView_DoubleClick(object sender, EventArgs e)
        {
            PrintLogMeta printLogMeta = (PrintLogMeta)gridView5.GetFocusedRow();

            int ID = printLogMeta.ID;

            HCMIS.Core.Distribution.Services.PrintLogService printout = new HCMIS.Core.Distribution.Services.PrintLogService();

            using  (SaveFileDialog SaveDialog = new SaveFileDialog())
            {
                SaveDialog.DefaultExt = ".pdf";
                if (SaveDialog.ShowDialog() != DialogResult.Cancel)
                {
                    printout.ToFile(ID, SaveDialog.FileName);
                    XtraMessageBox.Show("Your PDF is Exported", "Thanks");
                }
            }
        }
        private void gridPrintLogView_DoubleClick(object sender, EventArgs e)
        {
            PrintLogMeta printLog = (PrintLogMeta)gridPrintLogView.GetFocusedRow();
            if (printLog != null)
            {
                int ID = printLog.ID;

            HCMIS.Core.Distribution.Services.PrintLogService printout = new HCMIS.Core.Distribution.Services.PrintLogService();

                using (SaveFileDialog SaveDialog = new SaveFileDialog())
                {
                    SaveDialog.DefaultExt = ".pdf";
                    if (SaveDialog.ShowDialog() != DialogResult.Cancel)
                    {
                        printout.ToFile(ID, SaveDialog.FileName);
                        XtraMessageBox.Show("Your PDF is Exported", "Thanks");
                    }

                }
            }
        }
 private void btnPrintLogSaveAll_Click(object sender, EventArgs e)
 {
     using (SaveFileDialog SaveDialog = new SaveFileDialog())
     {
         if (SaveDialog.ShowDialog() != DialogResult.Cancel)
         {
             HCMIS.Core.Distribution.Services.PrintLogService            printout = new HCMIS.Core.Distribution.Services.PrintLogService();
             IEnumerable <HCMIS.Core.Distribution.Services.PrintLogMeta> logs     =
                 (IEnumerable <HCMIS.Core.Distribution.Services.PrintLogMeta>)gridPrintLog.DataSource;
             if (logs != null)
             {
                 foreach (var log in logs)
                 {
                     string fileName = SaveDialog.FileName + "_" + ((log.PrintedID != null) ?log.PrintedID : log.Reference) + "_" + MakeValidFileName(log.Description) + ".pdf";
                     printout.ToFile(log.ID, fileName);
                 }
                 XtraMessageBox.Show("All PDFs Exported", "Thanks");
             }
         }
     }
 }
        private void btnPrintLogSaveAll_Click(object sender, EventArgs e)
        {
            using (SaveFileDialog SaveDialog = new SaveFileDialog())
            {

                if (SaveDialog.ShowDialog() != DialogResult.Cancel)
                {
                    HCMIS.Core.Distribution.Services.PrintLogService printout = new HCMIS.Core.Distribution.Services.PrintLogService();
                    IEnumerable<HCMIS.Core.Distribution.Services.PrintLogMeta> logs =
                        (IEnumerable<HCMIS.Core.Distribution.Services.PrintLogMeta>) gridPrintLog.DataSource;
                    if (logs != null)
                    {
                        foreach (var log in logs)
                        {
                            string fileName = SaveDialog.FileName + "_" + ((log.PrintedID != null) ?log.PrintedID : log.Reference) + "_" + MakeValidFileName(log.Description) + ".pdf";
                            printout.ToFile(log.ID, fileName);
                        }
                        XtraMessageBox.Show("All PDFs Exported","Thanks");
                    }

                }

            }
        }