Example #1
0
        private void CombinePDF(string[] filePaths, DateTime dt, int sectionNo)
        {
            PdfDocument outPdf = new PdfDocument();

            for (int i = 0; i < filePaths.Length; i++)
            {
                PdfDocument one = PdfReader.Open(filePaths[i], PdfDocumentOpenMode.Import);
                CopyPages(one, outPdf);
            }
            string remotePath = Path.Combine(LisConfig.GetCombineRootPath(), LisConfig.GetSectionsName(sectionNo), dt.ToString("yyyy-MM-dd") + ".pdf");

            outPdf.Save(remotePath);
        }
Example #2
0
        private void GenderRemoteFile(DateTime dt)
        {
            string        directoryPath = Path.Combine(LisConfig.GetPdfRootPath(), DateTime.Now.ToString("yyyy-MM-dd"));
            DirectoryInfo di            = new DirectoryInfo(directoryPath);

            DirectoryInfo[] sectionDirectories = di.GetDirectories();
            string[]        filePaths;
            int             sectionNo;

            foreach (DirectoryInfo d in sectionDirectories)
            {
                if (int.TryParse(d.Name, out sectionNo))
                {
                    filePaths = Directory.GetFiles(d.FullName);
                    CombinePDF(filePaths, dt, sectionNo);
                }
            }
        }
Example #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            ReportManager rm          = new ReportManager();
            PDFManager    pm          = new PDFManager();
            LisReport     lr          = new LisReport();
            Hashtable     equalFields = new Hashtable();
            string        sql         = "select receivedate,sectionno,testtypeno,sampleno from ReportForm where receivedate='" + dateTimePicker1.Value.ToString("yyyy-MM-dd") + "' and Sectionno in(3,4,11,14,17,23,29,34,5,19,20,21,25,30,33,35,63,18,2,27,28,62)";
            DataTable     dt          = DbHelperSQL.Query(sql).Tables["dt"];
            DataSet       ds          = pm.GetPrintDataSet("ReportTables.frd");

            foreach (DataRow dr in dt.Rows)
            {
                equalFields.Clear();
                equalFields.Add("receivedate", (DateTime)dr["receivedate"]);
                equalFields.Add("sectionno", (int)dr["sectionno"]);
                equalFields.Add("testtypeno", (int)dr["testtypeno"]);
                equalFields.Add("sampleno", dr["sampleno"].ToString());
                rm.InitLisReport(lr, equalFields);
                pm.GenderPDFReport(lr, LisConfig.GetPdfRootPath(), ds);
            }
            //GenderRemoteFile(dateTimePicker1.Value);
        }
Example #4
0
        public static byte[] GetImage(string imagePath)
        {
            string fullPath = Path.Combine(LisConfig.GetGSRemotePath(), imagePath);

            return(IMGTools.ReadImageFile(fullPath));
        }