/// <summary> /// 文件合成 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOuput_Click(object sender, EventArgs e) { if (txtMagPDF.Text == "") { string msg = NCMessage.GetInstance(db.Language).GetMessageById("CM0085I", db.Language); MessageBox.Show(msg); return; } DataSet ds = new DataSet(); String wheresql = "发行编号=" + PublishId.ToString(); if (db.GetFile(0, 0, "*", wheresql, "文件序号", ref ds)) { ArrayList fileList = new ArrayList(); foreach (DataRow dr in ds.Tables[0].Rows) { String fname = dr["文件名称"].ToString(); if (!File.Exists(fname)) { string msg = String.Format(NCMessage.GetInstance(db.Language).GetMessageById("CM0087I", db.Language), fname); MessageBox.Show(msg); return; } fileList.Add(fname); } string[] files = new string[fileList.Count]; fileList.CopyTo(files); if (NCPDF.MergeFiles(txtMagPDF.Text, files)) { string msg = NCMessage.GetInstance(db.Language).GetMessageById("CM0088I", db.Language); MessageBox.Show(msg); } else { string msg = NCMessage.GetInstance(db.Language).GetMessageById("CM0089I", db.Language); MessageBox.Show(msg); } } else { string msg = NCMessage.GetInstance(db.Language).GetMessageById("CM0086I", db.Language); MessageBox.Show(msg); } }
/// <summary> /// 文件合并 /// </summary> /// <param name="pdffile"></param> /// <param name="publishid"></param> private void filemerge(string pdffile, string publishid) { if (pdffile == "") { string msg = NCMessage.GetInstance(db.Language).GetMessageById("CM0085I", db.Language); MessageBox.Show(msg); return; } DataSet ds = new DataSet(); String wheresql = "发行编号=" + publishid; if (db.GetFile(0, 0, "*", wheresql, "文件序号", ref ds)) { ArrayList fileList = new ArrayList(); foreach (DataRow dr in ds.Tables[0].Rows) { String fname = dr["文件名称"].ToString(); if (!File.Exists(fname)) { string msg = String.Format(NCMessage.GetInstance(db.Language).GetMessageById("CM0087I", db.Language), fname); MessageBox.Show(msg); return; } fileList.Add(fname); } string[] files = new string[fileList.Count]; fileList.CopyTo(files); if (NCPDF.MergeFiles(pdffile, files)) { string msg = NCMessage.GetInstance(db.Language).GetMessageById("CM0088I", db.Language); MessageBox.Show(msg); } else { string msg = NCMessage.GetInstance(db.Language).GetMessageById("CM0089I", db.Language); MessageBox.Show(msg); } } else { string msg = NCMessage.GetInstance(db.Language).GetMessageById("CM0086I", db.Language); MessageBox.Show(msg); } }