基线 SVN r240
SVN-Revision: r240
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
using O2S.Components.PDFView4NET;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubPdfSign.Controls
|
||||
{
|
||||
public static class ControlExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// 设置控件移动和调整大小
|
||||
/// </summary>
|
||||
public static void SetMove(this System.Windows.Forms.Control control)
|
||||
{
|
||||
//边框控件
|
||||
ResizeControl fControl = null;
|
||||
//上一个鼠标坐标
|
||||
Point lastPoint = new Point();
|
||||
|
||||
#region 绑定事件
|
||||
|
||||
//鼠标键按下时
|
||||
control.MouseDown += (sender, e) =>
|
||||
{
|
||||
//记录鼠标坐标
|
||||
lastPoint = Cursor.Position;
|
||||
|
||||
SignBox signBox = (SignBox)control.Tag;
|
||||
//清除所有控件的边框区域,最主要的是清除上次点击控件的边框,恢复原来状态
|
||||
foreach (System.Windows.Forms.Control ctrl in control.Parent.Controls)
|
||||
if (ctrl is ResizeControl)
|
||||
ctrl.Visible = false;
|
||||
if (fControl == null)
|
||||
{
|
||||
fControl = new ResizeControl(control);
|
||||
signBox.ParentResizeControl = fControl;
|
||||
}
|
||||
//设置边框背景色为透明,可以设置其它颜色
|
||||
fControl.BackColor = Color.Transparent;
|
||||
//把边框控件添加到当前控件的父控件中
|
||||
control.Parent.Controls.Add(fControl);
|
||||
if (control.Parent != null && control.Parent is PDFPageView)
|
||||
{
|
||||
if (control.Parent.Parent != null && control.Parent.Parent is PdfEditorEx)
|
||||
{
|
||||
(control.Parent.Parent as PdfEditorEx)._selectedSignBox = signBox;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//鼠标单击时
|
||||
control.MouseClick += (sender, e) =>
|
||||
{
|
||||
control.BringToFront();
|
||||
};
|
||||
|
||||
//鼠标在控件上移动时
|
||||
control.MouseMove += (sender, e) =>
|
||||
{
|
||||
Point currentPoint = new Point();
|
||||
Cursor.Current = Cursors.SizeAll;
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
currentPoint = Cursor.Position;
|
||||
control.Location = new Point(control.Location.X + currentPoint.X - lastPoint.X,
|
||||
control.Location.Y + currentPoint.Y - lastPoint.Y);
|
||||
|
||||
//移动时刷新实线
|
||||
fControl.DrawSolids();
|
||||
control.BringToFront();
|
||||
}
|
||||
|
||||
lastPoint = currentPoint;
|
||||
};
|
||||
|
||||
//鼠标键释放时
|
||||
control.MouseUp += (sender, e) =>
|
||||
{
|
||||
//设置控件区域
|
||||
fControl.SetControlRegion();
|
||||
System.Windows.Forms.Control pictureBox = (System.Windows.Forms.Control)sender;
|
||||
if (pictureBox.Tag != null && pictureBox.Tag is SignBox)
|
||||
{
|
||||
(pictureBox.Tag as SignBox).UpdateLocation();
|
||||
}
|
||||
};
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
|
||||
namespace Lskj.PubPdfSign.Controls
|
||||
{
|
||||
partial class PdfEditorEx
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PdfEditorEx));
|
||||
this.pdfDocument = new O2S.Components.PDFView4NET.PDFDocument();
|
||||
this.editToolStrip = new System.Windows.Forms.ToolStrip();
|
||||
this.btn_NextPage = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.btn_UpPage = new System.Windows.Forms.ToolStripButton();
|
||||
this.pdfPageView = new O2S.Components.PDFView4NET.PDFPageView();
|
||||
this.editToolStrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pdfDocument
|
||||
//
|
||||
this.pdfDocument.Metadata = null;
|
||||
this.pdfDocument.PageLayout = O2S.Components.PDFView4NET.PDFPageLayout.SinglePage;
|
||||
this.pdfDocument.PageMode = O2S.Components.PDFView4NET.PDFPageMode.UseNone;
|
||||
//
|
||||
// editToolStrip
|
||||
//
|
||||
this.editToolStrip.BackColor = System.Drawing.SystemColors.ControlLight;
|
||||
this.editToolStrip.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.editToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
|
||||
this.editToolStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.editToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.btn_NextPage,
|
||||
this.toolStripSeparator1,
|
||||
this.btn_UpPage});
|
||||
this.editToolStrip.Location = new System.Drawing.Point(0, 548);
|
||||
this.editToolStrip.Name = "editToolStrip";
|
||||
this.editToolStrip.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
|
||||
this.editToolStrip.ShowItemToolTips = false;
|
||||
this.editToolStrip.Size = new System.Drawing.Size(1027, 32);
|
||||
this.editToolStrip.TabIndex = 19;
|
||||
//
|
||||
// btn_NextPage
|
||||
//
|
||||
this.btn_NextPage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.btn_NextPage.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btn_NextPage.Image = ((System.Drawing.Image)(resources.GetObject("btn_NextPage.Image")));
|
||||
this.btn_NextPage.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.btn_NextPage.Name = "btn_NextPage";
|
||||
this.btn_NextPage.Size = new System.Drawing.Size(73, 29);
|
||||
this.btn_NextPage.Text = "下一页";
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 32);
|
||||
//
|
||||
// btn_UpPage
|
||||
//
|
||||
this.btn_UpPage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.btn_UpPage.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btn_UpPage.Image = ((System.Drawing.Image)(resources.GetObject("btn_UpPage.Image")));
|
||||
this.btn_UpPage.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.btn_UpPage.Name = "btn_UpPage";
|
||||
this.btn_UpPage.Size = new System.Drawing.Size(73, 29);
|
||||
this.btn_UpPage.Text = "上一页";
|
||||
//
|
||||
// pdfPageView
|
||||
//
|
||||
this.pdfPageView.BackColor = System.Drawing.Color.White;
|
||||
this.pdfPageView.DefaultEllipseAnnotationBorderWidth = 1D;
|
||||
this.pdfPageView.DefaultInkAnnotationWidth = 1D;
|
||||
this.pdfPageView.DefaultRectangleAnnotationBorderWidth = 1D;
|
||||
this.pdfPageView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pdfPageView.Document = this.pdfDocument;
|
||||
this.pdfPageView.DownscaleLargeImages = false;
|
||||
this.pdfPageView.EnableRepeatedKeys = false;
|
||||
this.pdfPageView.Location = new System.Drawing.Point(0, 0);
|
||||
this.pdfPageView.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.pdfPageView.Name = "pdfPageView";
|
||||
this.pdfPageView.PageNumber = 0;
|
||||
this.pdfPageView.RenderingProgressColor = System.Drawing.Color.Empty;
|
||||
this.pdfPageView.RenderingProgressDisplay = O2S.Components.PDFView4NET.PDFRenderingProgressDisplayMode.None;
|
||||
this.pdfPageView.RequiredFormFieldHighlightColor = System.Drawing.Color.Empty;
|
||||
this.pdfPageView.ScrollPosition = new System.Drawing.Point(0, 0);
|
||||
this.pdfPageView.Size = new System.Drawing.Size(1027, 548);
|
||||
this.pdfPageView.SubstituteFonts = null;
|
||||
this.pdfPageView.TabIndex = 20;
|
||||
this.pdfPageView.WorkMode = O2S.Components.PDFView4NET.UserInteractiveWorkMode.None;
|
||||
this.pdfPageView.ZoomMode = O2S.Components.PDFView4NET.PDFZoomMode.FitVisible;
|
||||
//
|
||||
// PdfEditorEx
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.Controls.Add(this.pdfPageView);
|
||||
this.Controls.Add(this.editToolStrip);
|
||||
this.Name = "PdfEditorEx";
|
||||
this.Size = new System.Drawing.Size(1027, 580);
|
||||
this.editToolStrip.ResumeLayout(false);
|
||||
this.editToolStrip.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private O2S.Components.PDFView4NET.PDFDocument pdfDocument;
|
||||
private System.Windows.Forms.ToolStrip editToolStrip;
|
||||
private System.Windows.Forms.ToolStripButton btn_NextPage;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||
private System.Windows.Forms.ToolStripButton btn_UpPage;
|
||||
private O2S.Components.PDFView4NET.PDFPageView pdfPageView;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,694 @@
|
||||
using iTextSharp.text;
|
||||
using iTextSharp.text.pdf;
|
||||
using Lskj.Business;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Control;
|
||||
using Lskj.Core;
|
||||
using O2S.Components.PDFView4NET;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubPdfSign.Controls
|
||||
{
|
||||
public partial class PdfEditorEx : UserControl
|
||||
{
|
||||
public PdfEditorEx()
|
||||
{
|
||||
InitializeComponent();
|
||||
//this.pdfPageView.ZoomMode = PDFZoomMode.Custom;
|
||||
this.SizeChanged += OnPdfEditorExSizeChanged;
|
||||
this.pdfPageView.SizeChanged += OnPdfEditorExSizeChanged;
|
||||
this.btn_UpPage.Click += OnBtnUpPageClick;
|
||||
this.btn_NextPage.Click += OnBtnNextPageClick;
|
||||
}
|
||||
/// <summary>
|
||||
/// PDF页面大小改变时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnPdfPageViewSizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
/// <summary>
|
||||
/// PDF页面大小改变时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnPdfEditorExSizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
int pageIndex = pdfPageView.PageNumber;
|
||||
if (pdfDocument.Pages.Count == 0 || pdfPageView.PageNumber > pdfDocument.Pages.Count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
List<SignBox> signBoxes = _signBoxList.Where(n => n.PageNumber == pdfPageView.PageNumber + 1).ToList();
|
||||
foreach (SignBox item in signBoxes)
|
||||
{
|
||||
if (item.ParentResizeControl != null)
|
||||
{
|
||||
item.ParentResizeControl.Visible = false;
|
||||
}
|
||||
ToSignBoxImage(item, pageIndex, item.AbsoluteX, item.AbsoluteY, item.PdfImageWidth, item.PdfImageHeight);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 记录全局选中控件
|
||||
/// </summary>
|
||||
public SignBox _selectedSignBox;
|
||||
/// <summary>
|
||||
/// 步骤表
|
||||
/// </summary>
|
||||
public DataTable StepTable = new DataTable();
|
||||
/// <summary>
|
||||
/// 保存完成后
|
||||
/// </summary>
|
||||
public event EventHandler OnAfterSignSaveCallback;
|
||||
/// <summary>
|
||||
/// 添加签章完成后
|
||||
/// </summary>
|
||||
public event EventHandler OnAfterSignAddCallback;
|
||||
public ToolStrip EditToolStrip { get { return this.editToolStrip; } }
|
||||
/// <summary>
|
||||
/// 关联模板id
|
||||
/// </summary>
|
||||
public string VersionCode;
|
||||
/// <summary>
|
||||
/// 源文件(该文件不进行编辑)
|
||||
/// </summary>
|
||||
public string TempletFilePath;
|
||||
/// <summary>
|
||||
/// 当前页码
|
||||
/// </summary>
|
||||
public int CurrentPageNo;
|
||||
/// <summary>
|
||||
/// 签名集合
|
||||
/// </summary>
|
||||
public List<SignBox> _signBoxList = new List<SignBox>();
|
||||
/// <summary>
|
||||
/// 当前操作文件
|
||||
/// </summary>
|
||||
private string _currentPdf;
|
||||
#region 事件
|
||||
/// <summary>
|
||||
/// 下一页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnNextPageClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.pdfPageView.PageNumber < this.pdfDocument.PageCount - 1)
|
||||
{
|
||||
this.pdfPageView.PageNumber++;
|
||||
this.CurrentPageNo = this.pdfPageView.PageNumber;
|
||||
this.FindSignBox();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 上一页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnUpPageClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.pdfPageView.PageNumber > 0)
|
||||
{
|
||||
this.pdfPageView.PageNumber--;
|
||||
this.CurrentPageNo = this.pdfPageView.PageNumber;
|
||||
this.FindSignBox();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public void OnBtnSaveClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(VersionCode))
|
||||
{
|
||||
MessageUtil.Show("请先设置版本名称并保存后再设计");
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(this._currentPdf)) return;
|
||||
string defaultSavePath = $"{Application.StartupPath}\\PdfSign\\PdfFileTemp\\signTempFile.pdf";
|
||||
string tempSavePath = $"{Application.StartupPath}\\PdfSign\\PdfFileSaveTemp\\signTempFile.pdf";
|
||||
if (!Directory.Exists(Path.GetDirectoryName(defaultSavePath)))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(defaultSavePath));
|
||||
}
|
||||
if (!Directory.Exists(Path.GetDirectoryName(tempSavePath)))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(tempSavePath));
|
||||
}
|
||||
this.Save(defaultSavePath);
|
||||
this.pdfDocument.Close();
|
||||
File.Copy(defaultSavePath, tempSavePath, true);
|
||||
foreach (SignBox signBox in this._signBoxList)
|
||||
{
|
||||
if (signBox.ParentPicBox != null)
|
||||
{
|
||||
signBox.ParentPicBox.Dispose();
|
||||
}
|
||||
if (signBox.ParentResizeControl != null)
|
||||
{
|
||||
signBox.ParentResizeControl.Dispose();
|
||||
}
|
||||
}
|
||||
this._signBoxList = new List<SignBox>();
|
||||
this._currentPdf = tempSavePath;
|
||||
this.pdfDocument.Load(this._currentPdf);
|
||||
LoadSign(VersionCode, true);
|
||||
//加载到保存前的页码位置
|
||||
this.pdfPageView.PageNumber = this.CurrentPageNo;
|
||||
if (OnAfterSignSaveCallback != null)
|
||||
{
|
||||
OnAfterSignSaveCallback(null, null);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 打开文件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnOpenClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
OpenLocalFile();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 签名删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnItemClick(object sender, EventArgs e)
|
||||
{
|
||||
ToolStripMenuItem toolStripMenuItem = (ToolStripMenuItem)sender;
|
||||
PictureBox pictureBox = (PictureBox)toolStripMenuItem.Tag;
|
||||
SignBox signBox = (SignBox)pictureBox.Tag;
|
||||
this._signBoxList.Remove(signBox);
|
||||
if (signBox.ParentPicBox != null)
|
||||
{
|
||||
signBox.ParentPicBox.Dispose();
|
||||
}
|
||||
if (signBox.ParentResizeControl != null)
|
||||
{
|
||||
signBox.ParentResizeControl.Dispose();
|
||||
}
|
||||
if (OnAfterSignAddCallback != null)
|
||||
{
|
||||
OnAfterSignAddCallback(null, null);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加签名控件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public void OnBtnAddSignClick(object sender, EventArgs e)
|
||||
{
|
||||
string selectSql = $"select * from P_SignLocationTable where mainId = '{VersionCode}'";
|
||||
DataTable dataTable = SqlHelper.ExecuteDataTable(selectSql);
|
||||
foreach (DataRow item in StepTable.Rows)
|
||||
{
|
||||
string stepCode = item["stepCode"] + "";
|
||||
string stepName = item["stepName"] + "";
|
||||
bool allowAdd = _signBoxList.Where(n => n.StepCode.Equals(stepCode)).Count() == 0;
|
||||
if (!allowAdd || dataTable.Rows.Cast<DataRow>().Where(n => (n["stepCode"] + "").Equals(stepCode)).Count() > 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
AddSignPicControl(stepCode);
|
||||
}
|
||||
}
|
||||
if (OnAfterSignAddCallback != null)
|
||||
{
|
||||
OnAfterSignAddCallback(null, null);
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
#region 方法
|
||||
/// <summary>
|
||||
/// 打开本地PDF文件
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string OpenLocalFile()
|
||||
{
|
||||
string fileName = string.Empty;
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
|
||||
openFileDialog.Filter = "(*.pdf)|*.pdf";
|
||||
openFileDialog.RestoreDirectory = true;
|
||||
openFileDialog.FilterIndex = 1;
|
||||
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
this._currentPdf = TempletFilePath = fileName = openFileDialog.FileName;
|
||||
this.pdfDocument.Load(this._currentPdf);
|
||||
//LoadSign();
|
||||
this.CurrentPageNo = 0;
|
||||
this.pdfPageView.PageNumber = this.CurrentPageNo;
|
||||
}
|
||||
return fileName;
|
||||
}
|
||||
public void OpenLocalFile(DataRow dataRow, bool allowSetMove = true)
|
||||
{
|
||||
ClearSignBox();
|
||||
string defaultDownPath = $"{Application.StartupPath}\\PdfSign\\PdfFileTemp\\downTempFile.pdf";
|
||||
string pdfUrl = dataRow["pdfUrl"] + "";
|
||||
pdfUrl = pdfUrl.StartsWith("http") ? pdfUrl : SystemInfo.Instance.OAUrl + pdfUrl;
|
||||
CloseDocument();
|
||||
using (WebClient webClient = new WebClient())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(Path.GetDirectoryName(defaultDownPath)))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(defaultDownPath));
|
||||
}
|
||||
File.Delete(defaultDownPath);
|
||||
webClient.DownloadFile(pdfUrl, defaultDownPath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
this._currentPdf = TempletFilePath = defaultDownPath;
|
||||
this.pdfDocument.Load(this._currentPdf);
|
||||
LoadSign(VersionCode, allowSetMove);
|
||||
this.CurrentPageNo = 0;
|
||||
this.pdfPageView.PageNumber = this.CurrentPageNo;
|
||||
}
|
||||
/// <summary>
|
||||
/// 加载已经存在的标签
|
||||
/// </summary>
|
||||
public void LoadSign(string versionCode, bool allowSetMove = true)
|
||||
{
|
||||
string selectSql = $"select * from P_SignLocationTable where mainId = '{versionCode}'";
|
||||
DataTable dataTable = SqlHelper.ExecuteDataTable(selectSql);
|
||||
string url = string.Empty;
|
||||
if (dataTable != null && dataTable.Rows.Count > 0)
|
||||
{
|
||||
this._signBoxList = new List<SignBox>();
|
||||
foreach (DataRow item in dataTable.Rows)
|
||||
{
|
||||
string stepName = string.Empty;
|
||||
url = item["pdfAdditionalUrl"] + "";
|
||||
string stepCode = item["stepCode"] + "";
|
||||
int imageHeight = (int)Convert.ToDecimal(item["pdfImageHeight"] + "");
|
||||
int imageWidth = (int)Convert.ToDecimal(item["pdfImageWidth"] + "");
|
||||
Bitmap image = new Bitmap(150, 50);
|
||||
if (stepCode.Equals("9999"))
|
||||
{
|
||||
url = "@select convert(varchar,getdate(),23)";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
if (url.StartsWith("http"))
|
||||
{
|
||||
using (WebClient webClient = new WebClient())
|
||||
{
|
||||
byte[] data = webClient.DownloadData(url);
|
||||
using (MemoryStream stream = new MemoryStream(data))
|
||||
{
|
||||
image = new Bitmap(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (url.StartsWith("@"))
|
||||
{
|
||||
try
|
||||
{
|
||||
string addInfo = BaseImpl.GetResult(url.TrimStart('@')) + "";
|
||||
using (Graphics graphics = Graphics.FromImage(image))
|
||||
{
|
||||
graphics.Clear(Color.Transparent);
|
||||
StringFormat stringFormat = new StringFormat
|
||||
{
|
||||
Alignment = StringAlignment.Center,
|
||||
LineAlignment = StringAlignment.Center
|
||||
};
|
||||
RectangleF rect = new RectangleF(0, 0, 150, 50);
|
||||
graphics.DrawString(addInfo, new System.Drawing.Font("微软雅黑", 16, FontStyle.Regular), new SolidBrush(Color.Black), rect, stringFormat);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
image = new Bitmap(100, 50);
|
||||
Graphics graphics = Graphics.FromImage(image);
|
||||
DataRow dataRow = StepTable.Rows.Cast<DataRow>().Where(n => (n["stepCode"] + "").Equals(stepCode)).FirstOrDefault();
|
||||
stepName = dataRow["stepName"] + "";
|
||||
StringFormat stringFormat = new StringFormat
|
||||
{
|
||||
Alignment = StringAlignment.Center,
|
||||
LineAlignment = StringAlignment.Center
|
||||
};
|
||||
RectangleF rect = new RectangleF(0, 0, 100, 50);
|
||||
graphics.DrawString(stepName, new System.Drawing.Font("微软雅黑", 24, FontStyle.Bold), new SolidBrush(Color.Green), rect, stringFormat);
|
||||
}
|
||||
SignBox signBox = new SignBox(pdfPageView, pdfDocument.Pages[pdfPageView.PageNumber]);
|
||||
PictureBox pictureBox = new PictureBox();
|
||||
pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
|
||||
|
||||
_signBoxList.Add(signBox);
|
||||
try
|
||||
{
|
||||
signBox.pdfAdditionalUrl = url;
|
||||
signBox.StepCode = stepCode;
|
||||
signBox.StepName = stepName;
|
||||
signBox.ParentPicBox = pictureBox;
|
||||
signBox.PageNumber = (int)Convert.ToDecimal(item["pageNum"] + "");
|
||||
pictureBox.BorderStyle = BorderStyle.None;
|
||||
pictureBox.Image = image;
|
||||
int pdfImageHeight = (int)Convert.ToDecimal(item["pdfImageHeight"] + "");
|
||||
int pdfImageWidth = (int)Convert.ToDecimal(item["pdfImageWidth"] + "");
|
||||
int absoluteY = (int)Convert.ToDecimal(item["absoluteY"] + "");
|
||||
int absoluteX = (int)Convert.ToDecimal(item["absoluteX"] + "");
|
||||
ToSignBoxImage(signBox, signBox.PageNumber - 1, absoluteX, absoluteY, pdfImageWidth, pdfImageHeight);
|
||||
//pictureBox.Height = signHeight;
|
||||
//pictureBox.Width = signWidth;
|
||||
pictureBox.Tag = signBox;
|
||||
pictureBox.Parent = this.pdfPageView;
|
||||
if (allowSetMove)
|
||||
{
|
||||
pictureBox.SetMove();
|
||||
}
|
||||
signBox.UpdateLocation();
|
||||
ContextMenuStrip cms = new ContextMenuStrip();
|
||||
cms.Items.Add("删除");
|
||||
cms.Items[0].Click += new EventHandler(OnItemClick);
|
||||
cms.Items[0].Tag = pictureBox;
|
||||
pictureBox.ContextMenuStrip = cms;
|
||||
|
||||
//pictureBox.BringToFront();
|
||||
//pictureBox.Location = new Point(signLeft, signTop);
|
||||
//pictureBox.MouseDown += new MouseEventHandler(OnPictureBox_MouseDown);
|
||||
//pictureBox.MouseMove += new MouseEventHandler(OnPictureBox_MouseMove);
|
||||
//pictureBox.MouseUp += new MouseEventHandler(OnPictureBox_MouseUp);
|
||||
//pictureBox.MouseClick += new MouseEventHandler(OnPictureBox_MouseClick);
|
||||
//pictureBox.MouseLeave += new EventHandler(OnPictureBox_MouseLeave);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
_signBoxList.Remove(signBox);
|
||||
pictureBox.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
FindSignBox();
|
||||
}
|
||||
/// <summary>
|
||||
/// 加载记录的sign坐标
|
||||
/// </summary>
|
||||
private void FindSignBox()
|
||||
{
|
||||
//翻页切换时候进行画点操作
|
||||
//List<SignBox> signBoxs = _signBoxList.Where(o => o.PageNumber == this.pdfPageView.PageNumber).ToList();
|
||||
foreach (SignBox item in this._signBoxList)
|
||||
{
|
||||
if (item.PageNumber != this.CurrentPageNo + 1)
|
||||
{
|
||||
if (item.ParentPicBox != null)
|
||||
{
|
||||
item.ParentPicBox.Parent = null;
|
||||
}
|
||||
if (item.ParentResizeControl != null)
|
||||
{
|
||||
item.ParentResizeControl.Parent = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.ParentPicBox != null)
|
||||
{
|
||||
item.ParentPicBox.Parent = this.pdfPageView;
|
||||
}
|
||||
if (item.ParentResizeControl != null)
|
||||
{
|
||||
item.ParentResizeControl.Parent = this.pdfPageView;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="savePath"></param>
|
||||
public void Save(string savePath)
|
||||
{
|
||||
StringBuilder sqlBulider = new StringBuilder();
|
||||
sqlBulider.Append($"delete from P_SignLocationTable where mainId = '{VersionCode}';\r\n");
|
||||
using (FileStream fileStream = new FileStream(savePath, FileMode.Create, FileAccess.ReadWrite))
|
||||
{
|
||||
using (PdfReader reader = new PdfReader(this._currentPdf))
|
||||
{
|
||||
PdfStamper stamper = new PdfStamper(reader, fileStream);
|
||||
int readPageNum = reader.NumberOfPages;
|
||||
for (int j = 0; j < readPageNum; j++)
|
||||
{
|
||||
double height = this.pdfDocument.Pages[j].Height;
|
||||
float width = (float)this.pdfDocument.Pages[j].Width;
|
||||
List<SignBox> signBoxes = this._signBoxList.Where(n => n.PageNumber == j + 1).ToList();
|
||||
foreach (SignBox item in signBoxes)
|
||||
{
|
||||
using (Bitmap cloneBitmap = new Bitmap(item.ParentPicBox.Image))
|
||||
{
|
||||
iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(cloneBitmap, ImageFormat.Png);
|
||||
}
|
||||
PDFPageRotation rotation = this.pdfDocument.Pages[this.CurrentPageNo].Rotation;
|
||||
int absoluteX = 0;
|
||||
int absoluteY = 0;
|
||||
int pdfImageWidth = 0;
|
||||
int pdfImageHeight = 0;
|
||||
if (rotation == PDFPageRotation.Rotate0Degrees)
|
||||
{
|
||||
PDFPoint pdfpoint = this.pdfPageView.ConvertScreenPointToPDFPoint(new Point(item.SignLeft, item.SignTop));
|
||||
PDFPoint pdfpoint2 = this.pdfPageView.ConvertScreenPointToPDFPoint(new Point(item.SignLeft + item.SignWidth, item.SignTop + item.SignHeight));
|
||||
absoluteX = (int)pdfpoint.X;
|
||||
absoluteY = (int)pdfpoint2.Y;
|
||||
pdfImageWidth = (int)(pdfpoint2.X - pdfpoint.X);
|
||||
pdfImageHeight = (int)(pdfpoint.Y - pdfpoint2.Y);
|
||||
}
|
||||
else if (rotation == PDFPageRotation.Rotate90Degrees)
|
||||
{
|
||||
PDFPoint pdfpoint4 = this.pdfPageView.ConvertScreenPointToPDFPoint(new Point(item.SignLeft + item.SignWidth, item.SignTop));
|
||||
PDFPoint pdfpoint5 = this.pdfPageView.ConvertScreenPointToPDFPoint(new Point(item.SignLeft, item.SignTop + item.SignHeight));
|
||||
absoluteX = (int)pdfpoint5.Y;
|
||||
absoluteY = (int)(width - (float)pdfpoint5.X);
|
||||
pdfImageWidth = (int)(pdfpoint4.Y - pdfpoint5.Y);
|
||||
pdfImageHeight = (int)(pdfpoint5.X - pdfpoint4.X);
|
||||
}
|
||||
PdfContentByte pdfContentByte = stamper.GetOverContent(j + 1);
|
||||
sqlBulider.Append($"insert into P_SignLocationTable (mainId, stepCode, pageNum, absoluteY, absoluteX, pdfImageWidth, pdfImageHeight, pdfAdditionalUrl) values ('{VersionCode}', '{item.StepCode}', '{item.PageNumber}', '{absoluteY}', '{absoluteX}', '{pdfImageWidth}', '{pdfImageHeight}', '{item.pdfAdditionalUrl}');\r\n");
|
||||
}
|
||||
}
|
||||
stamper.Close();
|
||||
}
|
||||
}
|
||||
SqlHelper.ExecuteNonQuery(sqlBulider.ToString());
|
||||
}
|
||||
/// <summary>
|
||||
/// 清理签名控件
|
||||
/// </summary>
|
||||
public void ClearSignBox()
|
||||
{
|
||||
foreach (SignBox signBox in _signBoxList)
|
||||
{
|
||||
if (signBox.ParentPicBox != null)
|
||||
{
|
||||
signBox.ParentPicBox.Dispose();
|
||||
}
|
||||
if (signBox.ParentResizeControl != null)
|
||||
{
|
||||
signBox.ParentResizeControl.Dispose();
|
||||
}
|
||||
}
|
||||
this._signBoxList.Clear();
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加签名控件
|
||||
/// </summary>
|
||||
public void AddSignPicControl(string stepCode, String urlPath = "")
|
||||
{
|
||||
Bitmap image = new Bitmap(100, 50);
|
||||
|
||||
string stepName = string.Empty;
|
||||
if (!String.IsNullOrEmpty(urlPath))
|
||||
{
|
||||
using (WebClient webClient = new WebClient())
|
||||
{
|
||||
byte[] data = webClient.DownloadData(urlPath);
|
||||
using (MemoryStream stream = new MemoryStream(data))
|
||||
{
|
||||
image = new Bitmap(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Graphics graphics = Graphics.FromImage(image);
|
||||
Pen pen = new Pen(Color.Black, 2);//
|
||||
graphics.DrawRectangle(pen, 0, 0, 100, 50);
|
||||
DataRow dataRow = StepTable.Rows.Cast<DataRow>().Where(n => (n["stepCode"] + "").Equals(stepCode)).FirstOrDefault();
|
||||
stepName = dataRow["stepName"] + "";
|
||||
graphics.DrawString(stepName, new System.Drawing.Font("微软雅黑", 26, FontStyle.Bold), Brushes.Green, new PointF(0, 0));
|
||||
}
|
||||
PictureBox pictureBox = new PictureBox();
|
||||
pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
|
||||
SignBox signBox = new SignBox(pdfPageView, pdfDocument.Pages[pdfPageView.PageNumber]);
|
||||
_signBoxList.Add(signBox);
|
||||
try
|
||||
{
|
||||
signBox.StepName = stepName;
|
||||
signBox.pdfAdditionalUrl = urlPath;
|
||||
signBox.StepCode = stepCode;
|
||||
signBox.ParentPicBox = pictureBox;
|
||||
signBox.PageNumber = this.CurrentPageNo + 1;
|
||||
if (string.IsNullOrEmpty(urlPath))
|
||||
{
|
||||
signBox.SignHeight = 30;
|
||||
signBox.SignWidth = 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
signBox.SignHeight = image.Height;
|
||||
signBox.SignWidth = image.Width;
|
||||
|
||||
}
|
||||
signBox.SignTop = 0;
|
||||
signBox.SignLeft = 0;
|
||||
pictureBox.BorderStyle = BorderStyle.None;
|
||||
pictureBox.Image = image;
|
||||
//pictureBox.Height = signHeight;
|
||||
//pictureBox.Width = signWidth;
|
||||
pictureBox.Tag = signBox;
|
||||
pictureBox.Parent = this.pdfPageView;
|
||||
pictureBox.SetMove();
|
||||
signBox.UpdateLocation();
|
||||
|
||||
ContextMenuStrip cms = new ContextMenuStrip();
|
||||
cms.Items.Add("删除");
|
||||
cms.Items[0].Click += new EventHandler(OnItemClick);
|
||||
cms.Items[0].Tag = pictureBox;
|
||||
pictureBox.ContextMenuStrip = cms;
|
||||
//pictureBox.BringToFront();
|
||||
//pictureBox.Location = new Point(signLeft, signTop);
|
||||
//pictureBox.MouseDown += new MouseEventHandler(OnPictureBox_MouseDown);
|
||||
//pictureBox.MouseMove += new MouseEventHandler(OnPictureBox_MouseMove);
|
||||
//pictureBox.MouseUp += new MouseEventHandler(OnPictureBox_MouseUp);
|
||||
//pictureBox.MouseClick += new MouseEventHandler(OnPictureBox_MouseClick);
|
||||
//pictureBox.MouseLeave += new EventHandler(OnPictureBox_MouseLeave);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
_signBoxList.Remove(signBox);
|
||||
pictureBox.Dispose();
|
||||
}
|
||||
}
|
||||
public iTextSharp.text.Image ToPdfImage(SignBox signBox, int pageIndex)
|
||||
{
|
||||
float width = (float)this.pdfDocument.Pages[pageIndex].Width;
|
||||
iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(signBox.ParentPicBox.Image, ImageFormat.Bmp);//获取图片
|
||||
PDFPageRotation rotation = this.pdfDocument.Pages[this.CurrentPageNo].Rotation;
|
||||
if (rotation == PDFPageRotation.Rotate0Degrees)
|
||||
{
|
||||
PDFPoint pdfpoint = this.pdfPageView.ConvertScreenPointToPDFPoint(new Point(signBox.SignLeft, signBox.SignTop));
|
||||
PDFPoint pdfpoint2 = this.pdfPageView.ConvertScreenPointToPDFPoint(new Point(signBox.SignLeft + signBox.SignWidth, signBox.SignTop + signBox.SignHeight));
|
||||
image.ScaleAbsolute((float)(pdfpoint2.X - pdfpoint.X), (float)(pdfpoint.Y - pdfpoint2.Y));
|
||||
image.SetAbsolutePosition((float)pdfpoint.X, (float)pdfpoint2.Y);
|
||||
}
|
||||
else if (rotation == PDFPageRotation.Rotate90Degrees)
|
||||
{
|
||||
PDFPoint pdfpoint4 = this.pdfPageView.ConvertScreenPointToPDFPoint(new Point(signBox.SignLeft + signBox.SignWidth, signBox.SignTop));
|
||||
PDFPoint pdfpoint5 = this.pdfPageView.ConvertScreenPointToPDFPoint(new Point(signBox.SignLeft, signBox.SignTop + signBox.SignHeight));
|
||||
image.ScaleAbsolute((float)(pdfpoint4.Y - pdfpoint5.Y), (float)(pdfpoint5.X - pdfpoint4.X));
|
||||
image.SetAbsolutePosition((float)pdfpoint5.Y, width - (float)pdfpoint5.X);
|
||||
}
|
||||
return image;
|
||||
}
|
||||
public SignBox ToSignBoxImage(SignBox signBox, int pageIndex, double absoluteX, double absoluteY, double pdfImageWidth, double pdfImageHeight)
|
||||
{
|
||||
float width = (float)this.pdfDocument.Pages[pageIndex].Width;
|
||||
PDFPageRotation rotation = this.pdfDocument.Pages[this.CurrentPageNo].Rotation;
|
||||
if (rotation == PDFPageRotation.Rotate0Degrees)
|
||||
{
|
||||
PDFPoint pdfpoint = new PDFPoint(absoluteX, pdfImageHeight + absoluteY);
|
||||
PDFPoint pdfpoint2 = new PDFPoint(pdfImageWidth + absoluteX, absoluteY);
|
||||
Point point = this.pdfPageView.ConvertPDFPointToScreenPoint(pdfpoint);
|
||||
Point point2 = this.pdfPageView.ConvertPDFPointToScreenPoint(pdfpoint2);
|
||||
signBox.SignLeft = point.X;
|
||||
signBox.SignTop = point.Y;
|
||||
signBox.SignWidth = point2.X - signBox.SignLeft;
|
||||
signBox.SignHeight = point2.Y - signBox.SignTop;
|
||||
}
|
||||
else if (rotation == PDFPageRotation.Rotate90Degrees)
|
||||
{
|
||||
PDFPoint pdfpoint4 = new PDFPoint(width - absoluteY - pdfImageHeight, pdfImageWidth + absoluteX);
|
||||
PDFPoint pdfpoint5 = new PDFPoint(width - absoluteY, absoluteX);
|
||||
Point point4 = this.pdfPageView.ConvertPDFPointToScreenPoint(pdfpoint4);
|
||||
Point point5 = this.pdfPageView.ConvertPDFPointToScreenPoint(pdfpoint5);
|
||||
signBox.SignLeft = point5.X;
|
||||
signBox.SignTop = point4.Y;
|
||||
signBox.SignWidth = point4.X - signBox.SignLeft;
|
||||
signBox.SignHeight = point5.Y - signBox.SignTop;
|
||||
}
|
||||
return signBox;
|
||||
}
|
||||
/// <summary>
|
||||
/// 关闭文档
|
||||
/// </summary>
|
||||
public void CloseDocument()
|
||||
{
|
||||
this.pdfDocument.Close();
|
||||
this.pdfDocument.Dispose();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="pdfDocument.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="editToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>480, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="btn_NextPage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="btn_UpPage.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,38 @@
|
||||
|
||||
namespace Lskj.PubPdfSign.Controls
|
||||
{
|
||||
partial class ResizeControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,442 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubPdfSign.Controls
|
||||
{
|
||||
public partial class ResizeControl : UserControl
|
||||
{
|
||||
public ResizeControl(System.Windows.Forms.Control control)
|
||||
{
|
||||
//InitializeComponent();
|
||||
this.control = control;
|
||||
|
||||
#region 绑定事件
|
||||
|
||||
//鼠标按下时
|
||||
MouseDown += (sender, e) =>
|
||||
{
|
||||
//记录鼠标位置
|
||||
lastPoint = Cursor.Position;
|
||||
|
||||
//改变鼠标状态
|
||||
SetCursor(e.X, e.Y);
|
||||
};
|
||||
|
||||
//鼠标移动时,即在调整控件大小
|
||||
MouseMove += (sender, e) =>
|
||||
{
|
||||
//鼠标左键
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
//移动时刷新实线
|
||||
DrawSolids();
|
||||
|
||||
//调整控件大小
|
||||
ReCtrlSize();
|
||||
}
|
||||
//不是鼠标左键,则表示只是在控件上移动
|
||||
else
|
||||
{
|
||||
//改变鼠标状态
|
||||
SetCursor(e.X, e.Y);
|
||||
}
|
||||
};
|
||||
|
||||
//鼠标键释放时
|
||||
MouseUp += (sender, e) =>
|
||||
{
|
||||
control.Refresh();
|
||||
//显示虚线
|
||||
SetControlRegion();
|
||||
|
||||
System.Windows.Forms.Control pictureBox = (System.Windows.Forms.Control)sender;
|
||||
if (pictureBox.Tag != null && pictureBox.Tag is SignBox)
|
||||
{
|
||||
(pictureBox.Tag as SignBox).UpdateLocation();
|
||||
}
|
||||
};
|
||||
|
||||
////鼠标离开控件隐藏边框
|
||||
//MouseLeave += (sender, e) =>
|
||||
//{
|
||||
// this.Visible = false;
|
||||
//};
|
||||
|
||||
//大小改变时
|
||||
SizeChanged += (sender, e) =>
|
||||
{
|
||||
isSizeChanged = true;
|
||||
};
|
||||
|
||||
#endregion
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否已经改变大小,默认大小(150,150)不运行OnPaint方法,避免出现异常绘制
|
||||
/// </summary>
|
||||
bool isSizeChanged = false;
|
||||
|
||||
/// <summary>
|
||||
/// 设置控件支持透明
|
||||
/// </summary>
|
||||
protected override CreateParams CreateParams
|
||||
{
|
||||
get
|
||||
{
|
||||
CreateParams cp = base.CreateParams;
|
||||
cp.ExStyle |= 0x20;
|
||||
return cp;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绘制虚线:4条虚线和8个小矩形
|
||||
/// </summary>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
//默认大小,去除绘制,避免出现异常绘制
|
||||
if (isSizeChanged == false) return;
|
||||
|
||||
DrawDottedLines(e.Graphics);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当前控件
|
||||
/// </summary>
|
||||
System.Windows.Forms.Control control;
|
||||
|
||||
/// <summary>
|
||||
/// 上一个鼠标坐标
|
||||
/// </summary>
|
||||
Point lastPoint = new Point();
|
||||
|
||||
/// <summary>
|
||||
/// 包括边框的局域
|
||||
/// </summary>
|
||||
Rectangle controlRect;
|
||||
/// <summary>
|
||||
/// 4条底边的集合
|
||||
/// </summary>
|
||||
Rectangle[] borderRects = new Rectangle[4];
|
||||
|
||||
/// <summary>
|
||||
/// 组成4条虚线的点
|
||||
/// </summary>
|
||||
Point[] linePoints = new Point[5];
|
||||
|
||||
/// <summary>
|
||||
/// 8个小矩形大小
|
||||
/// </summary>
|
||||
const int size = 6;
|
||||
/// <summary>
|
||||
/// 8个小矩形的大小
|
||||
/// </summary>
|
||||
Size smallRectSize = new Size(size, size);
|
||||
/// <summary>
|
||||
/// 8个小矩形
|
||||
/// </summary>
|
||||
Rectangle[] smallRects = new Rectangle[8];
|
||||
|
||||
#region 设置控件区域,绘制虚线,绘制实线
|
||||
|
||||
/// <summary>
|
||||
/// 设置控件区域:4条底边,点击控件后显示
|
||||
/// </summary>
|
||||
public void SetControlRegion()
|
||||
{
|
||||
//显示边框并置顶
|
||||
Visible = true;
|
||||
BringToFront();
|
||||
|
||||
#region 设置控件区域
|
||||
|
||||
int x = control.Bounds.X - smallRectSize.Width;
|
||||
int y = control.Bounds.Y - smallRectSize.Height;
|
||||
int width = control.Bounds.Width + (smallRectSize.Width * 2);
|
||||
int height = control.Bounds.Height + (smallRectSize.Height * 2);
|
||||
Bounds = new Rectangle(x, y, width, height);
|
||||
|
||||
//包括边框的局域
|
||||
controlRect = new Rectangle(new Point(0, 0), Bounds.Size);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 4条底边
|
||||
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
|
||||
//上底边
|
||||
borderRects[0] = new Rectangle(0, 0, Width + size * 2, smallRectSize.Height + 1);
|
||||
//左底边
|
||||
borderRects[1] = new Rectangle(0, size + 1, smallRectSize.Width + 1, Height - size * 2 - 2);
|
||||
//下底边
|
||||
borderRects[2] = new Rectangle(0, Height - size - 1, Width + size * 2, smallRectSize.Height + 1);
|
||||
//右底边
|
||||
borderRects[3] = new Rectangle(Width - size - 1, size + 1, smallRectSize.Width + 1, Height - size * 2 - 2);
|
||||
|
||||
path.AddRectangle(borderRects[0]);
|
||||
path.AddRectangle(borderRects[1]);
|
||||
path.AddRectangle(borderRects[2]);
|
||||
path.AddRectangle(borderRects[3]);
|
||||
|
||||
Region = new Region(path);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绘制虚线:4条虚线和8个小矩形
|
||||
/// </summary>
|
||||
public void DrawDottedLines(Graphics g)
|
||||
{
|
||||
#region 4条虚线
|
||||
|
||||
//左上
|
||||
linePoints[0] = new Point(3, 3);
|
||||
//右上
|
||||
linePoints[1] = new Point(Width - 3 - 1, 3);
|
||||
//右下
|
||||
linePoints[2] = new Point(Width - 3 - 1, Height - 3 - 1);
|
||||
//左下
|
||||
linePoints[3] = new Point(3, Height - 3 - 1);
|
||||
//左上
|
||||
linePoints[4] = new Point(3, 3);
|
||||
|
||||
Pen pen = new Pen(Color.Black, 1) { DashStyle = DashStyle.Dot };
|
||||
|
||||
g.DrawLines(pen, linePoints);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 8个小矩形
|
||||
|
||||
//左上
|
||||
smallRects[0] = new Rectangle(new Point(0, 0), smallRectSize);
|
||||
//右上
|
||||
smallRects[1] = new Rectangle(new Point(Width - size - 1, 0), smallRectSize);
|
||||
//左下
|
||||
smallRects[2] = new Rectangle(new Point(0, Height - size - 1), smallRectSize);
|
||||
//右下
|
||||
smallRects[3] = new Rectangle(new Point(Width - size - 1, Height - size - 1), smallRectSize);
|
||||
//上中
|
||||
smallRects[4] = new Rectangle(new Point(Width / 2 - 1, 0), smallRectSize);
|
||||
//下中
|
||||
smallRects[5] = new Rectangle(new Point(Width / 2 - 1, Height - size - 1), smallRectSize);
|
||||
//左中
|
||||
smallRects[6] = new Rectangle(new Point(0, Height / 2 - size / 2), smallRectSize);
|
||||
//右中
|
||||
smallRects[7] = new Rectangle(new Point(Width - size - 1, Height / 2 - size / 2), smallRectSize);
|
||||
|
||||
//填充矩形内部为白色
|
||||
g.FillRectangles(Brushes.White, smallRects);
|
||||
//绘制矩形
|
||||
g.DrawRectangles(Pens.Black, smallRects);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绘制实线:4条实线,移动控件和调整控件大小时显示
|
||||
/// </summary>
|
||||
public void DrawSolids()
|
||||
{
|
||||
//隐藏边框
|
||||
Visible = false;
|
||||
Graphics g = control.CreateGraphics();
|
||||
int width = control.Width;
|
||||
int height = control.Height;
|
||||
Point[] points = new Point[5] { new Point(0,0),new Point(width - 1,0),
|
||||
new Point(width - 1,height-1),new Point(0,height-1),new Point(0,0)};
|
||||
g.DrawLines(new Pen(Color.Gray, 3), points);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 调整控件大小
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标在控件中的位置
|
||||
/// </summary>
|
||||
enum MousePos
|
||||
{
|
||||
None,
|
||||
Top,
|
||||
Right,
|
||||
Bottom,
|
||||
Left,
|
||||
LeftTop,
|
||||
LeftBottom,
|
||||
RightTop,
|
||||
RightBottom
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标在控件中的位置
|
||||
/// </summary>
|
||||
MousePos mousePos;
|
||||
|
||||
/// <summary>
|
||||
/// 改变鼠标状态,鼠标在控件上,下,左,右,左上,右上,左下,右下,向上不同的光标
|
||||
/// </summary>
|
||||
private void SetCursor(int x, int y)
|
||||
{
|
||||
Point point = new Point(x, y);
|
||||
|
||||
if (!controlRect.Contains(point))//不在边框局域内直接退出
|
||||
{
|
||||
Cursor.Current = Cursors.Arrow;
|
||||
return;
|
||||
}
|
||||
else if (smallRects[0].Contains(point))//左上
|
||||
{
|
||||
Cursor.Current = Cursors.SizeNWSE;
|
||||
mousePos = MousePos.LeftTop;
|
||||
}
|
||||
else if (smallRects[1].Contains(point))//右上
|
||||
{
|
||||
Cursor.Current = Cursors.SizeNESW;
|
||||
mousePos = MousePos.RightTop;
|
||||
}
|
||||
else if (smallRects[2].Contains(point))//左下
|
||||
{
|
||||
Cursor.Current = Cursors.SizeNESW;
|
||||
mousePos = MousePos.LeftBottom;
|
||||
}
|
||||
else if (smallRects[3].Contains(point))//右下
|
||||
{
|
||||
Cursor.Current = Cursors.SizeNWSE;
|
||||
mousePos = MousePos.RightBottom;
|
||||
}
|
||||
|
||||
else if (borderRects[0].Contains(point))//上
|
||||
{
|
||||
Cursor.Current = Cursors.SizeNS;
|
||||
mousePos = MousePos.Top;
|
||||
}
|
||||
else if (borderRects[1].Contains(point))//左
|
||||
{
|
||||
Cursor.Current = Cursors.SizeWE;
|
||||
mousePos = MousePos.Left;
|
||||
}
|
||||
else if (borderRects[2].Contains(point))//下
|
||||
{
|
||||
Cursor.Current = Cursors.SizeNS;
|
||||
mousePos = MousePos.Bottom;
|
||||
}
|
||||
else if (borderRects[3].Contains(point))//右
|
||||
{
|
||||
Cursor.Current = Cursors.SizeWE;
|
||||
mousePos = MousePos.Right;
|
||||
}
|
||||
else
|
||||
{
|
||||
Cursor.Current = Cursors.Arrow;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 控件的最小高度
|
||||
/// </summary>
|
||||
const int MinHeight = 10;
|
||||
/// <summary>
|
||||
/// 控件的最小宽度
|
||||
/// </summary>
|
||||
const int MinWeight = 10;
|
||||
|
||||
/// <summary>
|
||||
/// 调整控件大小:鼠标在控件中的不同位置,调整控件大小
|
||||
/// </summary>
|
||||
private void ReCtrlSize()
|
||||
{
|
||||
//获取当前鼠标位置
|
||||
Point currentPoint = Cursor.Position;
|
||||
int x = currentPoint.X - lastPoint.X;
|
||||
int y = currentPoint.Y - lastPoint.Y;
|
||||
switch (mousePos)
|
||||
{
|
||||
case MousePos.None:
|
||||
break;
|
||||
case MousePos.Top://上,调整
|
||||
if (control.Height - y > MinHeight)
|
||||
{
|
||||
control.Top += y;
|
||||
control.Height -= y;
|
||||
}
|
||||
break;
|
||||
case MousePos.Right:
|
||||
if (control.Width + x > MinWeight)
|
||||
{
|
||||
control.Width += x;
|
||||
}
|
||||
break;
|
||||
case MousePos.Bottom:
|
||||
if (control.Height + y > MinHeight)
|
||||
{
|
||||
control.Height += y;
|
||||
}
|
||||
break;
|
||||
case MousePos.Left:
|
||||
if (control.Width - x > MinWeight)
|
||||
{
|
||||
control.Left += x;
|
||||
control.Width -= x;
|
||||
}
|
||||
break;
|
||||
case MousePos.LeftTop://左上
|
||||
if (control.Width - x > MinWeight)
|
||||
{
|
||||
control.Left += x;
|
||||
control.Width -= x;
|
||||
}
|
||||
if (control.Height - y > MinHeight)
|
||||
{
|
||||
control.Top += y;
|
||||
control.Height -= y;
|
||||
}
|
||||
break;
|
||||
case MousePos.LeftBottom:
|
||||
if (control.Width - x > MinWeight)
|
||||
{
|
||||
control.Left += x;
|
||||
control.Width -= x;
|
||||
}
|
||||
if (control.Height + y > MinHeight)
|
||||
{
|
||||
control.Height += y;
|
||||
}
|
||||
break;
|
||||
case MousePos.RightTop:
|
||||
if (control.Width + x > MinWeight)
|
||||
{
|
||||
control.Width += x;
|
||||
}
|
||||
if (control.Height - y > MinHeight)
|
||||
{
|
||||
control.Top += y;
|
||||
control.Height -= y;
|
||||
}
|
||||
break;
|
||||
case MousePos.RightBottom:
|
||||
if (control.Width + x > MinWeight)
|
||||
{
|
||||
control.Width += x;
|
||||
}
|
||||
if (control.Height + y > MinHeight)
|
||||
{
|
||||
control.Height += y;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
lastPoint = Cursor.Position;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
using O2S.Components.PDFView4NET;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubPdfSign.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// 签名box对象
|
||||
/// </summary>
|
||||
public class SignBox
|
||||
{
|
||||
public SignBox(PDFPageView _PageView, PDFPage _Page)
|
||||
{
|
||||
PageView = _PageView;
|
||||
Page = _Page;
|
||||
}
|
||||
/// <summary>
|
||||
/// PDF文档控件
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public PDFPageView PageView { get; set; }
|
||||
/// <summary>
|
||||
/// 父图片控件
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public PictureBox ParentPicBox { get; set; }
|
||||
/// <summary>
|
||||
/// 父边框控件
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public ResizeControl ParentResizeControl { get; set; }
|
||||
/// <summary>
|
||||
/// 图片地址
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public string ParentPicBoxImagePath { get; set; }
|
||||
/// <summary>
|
||||
/// 页码
|
||||
/// </summary>
|
||||
/// <value>The page number.</value>
|
||||
[Browsable(false)]
|
||||
public int PageNumber { get; set; }
|
||||
/// <summary>
|
||||
/// PDF页面
|
||||
/// </summary>
|
||||
/// <value>The page number.</value>
|
||||
[Browsable(false)]
|
||||
public PDFPage Page { get; set; }
|
||||
/// <summary>
|
||||
/// 坐标
|
||||
/// </summary>
|
||||
/// <value>The point.</value>
|
||||
[Browsable(false)]
|
||||
public Point PointObj { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤
|
||||
/// </summary>
|
||||
/// <value>The point.</value>
|
||||
[Browsable(false)]
|
||||
public string StepCode { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤名字
|
||||
/// </summary>
|
||||
/// <value>The point.</value>
|
||||
[Browsable(false)]
|
||||
public string StepName { get; set; }
|
||||
/// <summary>
|
||||
/// 宽度
|
||||
/// </summary>
|
||||
public int PdfImageWidth { get; private set; }
|
||||
/// <summary>
|
||||
/// 宽度
|
||||
/// </summary>
|
||||
public int SignWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return ParentPicBox.Width;
|
||||
}
|
||||
set
|
||||
{
|
||||
ParentPicBox.Width = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 高度
|
||||
/// </summary>
|
||||
public int PdfImageHeight { get; private set; }
|
||||
/// <summary>
|
||||
/// 高度
|
||||
/// </summary>
|
||||
public int SignHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return ParentPicBox.Height;
|
||||
}
|
||||
set
|
||||
{
|
||||
ParentPicBox.Height = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 左边距
|
||||
/// </summary>
|
||||
public int AbsoluteX { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 左边距
|
||||
/// </summary>
|
||||
public int SignLeft
|
||||
{
|
||||
get
|
||||
{
|
||||
return ParentPicBox.Left;
|
||||
}
|
||||
set
|
||||
{
|
||||
ParentPicBox.Left = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 左边距
|
||||
/// </summary>
|
||||
public int AbsoluteY { get; private set; }
|
||||
/// <summary>
|
||||
/// 上边距
|
||||
/// </summary>
|
||||
public int SignTop
|
||||
{
|
||||
get
|
||||
{
|
||||
return ParentPicBox.Top;
|
||||
}
|
||||
set
|
||||
{
|
||||
ParentPicBox.Top = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否移动状态
|
||||
/// </summary>
|
||||
[BrowsableAttribute(false)]
|
||||
public bool IsMove { get; set; }
|
||||
/// <summary>
|
||||
/// 鼠标点击位置
|
||||
/// </summary>
|
||||
[BrowsableAttribute(false)]
|
||||
public Point MouseDownPoint { get; set; }
|
||||
/// <summary>
|
||||
/// 附加文件地址
|
||||
/// </summary>
|
||||
public string pdfAdditionalUrl { get; set; }
|
||||
/// <summary>
|
||||
/// 更新位置信息
|
||||
/// </summary>
|
||||
public void UpdateLocation()
|
||||
{
|
||||
float width = (float)Page.Width;
|
||||
if (Page.Rotation == PDFPageRotation.Rotate0Degrees)
|
||||
{
|
||||
PDFPoint pdfpoint = PageView.ConvertScreenPointToPDFPoint(new Point(SignLeft, SignTop));
|
||||
PDFPoint pdfpoint2 = PageView.ConvertScreenPointToPDFPoint(new Point(SignLeft + SignWidth, SignTop + SignHeight));
|
||||
AbsoluteX = (int)pdfpoint.X;
|
||||
AbsoluteY = (int)pdfpoint2.Y;
|
||||
PdfImageWidth = (int)(pdfpoint2.X - pdfpoint.X);
|
||||
PdfImageHeight = (int)(pdfpoint.Y - pdfpoint2.Y);
|
||||
}
|
||||
else if (Page.Rotation == PDFPageRotation.Rotate90Degrees)
|
||||
{
|
||||
PDFPoint pdfpoint4 = PageView.ConvertScreenPointToPDFPoint(new Point(SignLeft + SignWidth, SignTop));
|
||||
PDFPoint pdfpoint5 = PageView.ConvertScreenPointToPDFPoint(new Point(SignLeft, SignTop + SignHeight));
|
||||
AbsoluteX = (int)pdfpoint5.Y;
|
||||
AbsoluteY = (int)(width - (float)pdfpoint5.X);
|
||||
PdfImageWidth = (int)(pdfpoint4.Y - pdfpoint5.Y);
|
||||
PdfImageHeight = (int)(pdfpoint5.X - pdfpoint4.X);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
/******************************
|
||||
* 说明:Lskj.PubPageDetail 入口函数
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2018-04-03
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using Lskj.Business;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Core;
|
||||
using Lskj.Model;
|
||||
using Lskj.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubPdfSign
|
||||
{
|
||||
/// <summary>
|
||||
/// c#库被调用统一接口类
|
||||
/// </summary>
|
||||
public sealed class DllBaseClass : IForm
|
||||
{
|
||||
public DllBaseClass()
|
||||
{
|
||||
}
|
||||
public DllBaseClass(string[] obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
DynamicPdfSignModel pdfSignModel = new DynamicPdfSignModel(obj);
|
||||
CreateSignTempTable();
|
||||
CreateSignLocationTable();
|
||||
if (string.IsNullOrEmpty(pdfSignModel.Type) || (pdfSignModel.Type + "").Equals("0"))
|
||||
{
|
||||
FrmDesign main = new FrmDesign();
|
||||
this.SubForm = main;
|
||||
main.PdfSignModel = pdfSignModel;
|
||||
|
||||
}
|
||||
else if ((pdfSignModel.Type + "").Equals("1") || (pdfSignModel.Type + "").Equals("2"))
|
||||
{
|
||||
FrmAddSign main = new FrmAddSign();
|
||||
this.SubForm = main;
|
||||
main.PdfSignModel = pdfSignModel;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogUtil.WriteError("Lskj.PubPdfSign.dll--参数错误-->" + obj.ToString(), ex);
|
||||
}
|
||||
}
|
||||
private void CreateSignTempTable()
|
||||
{
|
||||
Dictionary<string, string> tableColDic = new Dictionary<string, string>();
|
||||
tableColDic.Add("versionName", "varchar(200)");
|
||||
tableColDic.Add("pdfUrl", "varchar(1000)");
|
||||
BaseImpl.CheckTable(tableColDic, "P_SignTempTable");
|
||||
}
|
||||
private void CreateSignLocationTable()
|
||||
{
|
||||
Dictionary<string, string> tableColDic = new Dictionary<string, string>();
|
||||
tableColDic.Add("mainId", "int");
|
||||
tableColDic.Add("stepCode", "varchar(100)");
|
||||
tableColDic.Add("pageNum", "int");
|
||||
tableColDic.Add("absoluteY", "numeric(18,2)");
|
||||
tableColDic.Add("absoluteX", "numeric(18,2)");
|
||||
tableColDic.Add("pdfImageWidth", "numeric(18,2)");
|
||||
tableColDic.Add("pdfImageHeight", "numeric(18,2)");
|
||||
BaseImpl.CheckTable(tableColDic, "P_SignLocationTable");
|
||||
}
|
||||
/// <summary>
|
||||
/// 窗口
|
||||
/// </summary>
|
||||
public Form SubForm { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 入口模型
|
||||
/// </summary>
|
||||
public class DynamicPdfSignModel : DynamicModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 审批模块号
|
||||
/// </summary>
|
||||
/// <value>The primary value.</value>
|
||||
public string TypeCode { get; private set; }
|
||||
/// <summary>
|
||||
/// 审批步骤号
|
||||
/// </summary>
|
||||
/// <value>The primary value.</value>
|
||||
public string StepCode { get; private set; }
|
||||
/// <summary>
|
||||
/// 单据主键
|
||||
/// </summary>
|
||||
public string PrimaryValue { get; private set; }
|
||||
/// <summary>
|
||||
/// 签章版本号
|
||||
/// </summary>
|
||||
public string VersionCode { get; private set; }
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
/// <value>0设计,1签章预览, 2签章预览并上传</value>
|
||||
public string Type { get; private set; }
|
||||
/// <summary>
|
||||
/// 是否是已完成单据
|
||||
/// </summary>
|
||||
/// <value>0否,1是</value>
|
||||
public string IsFinishPage { get; private set; }
|
||||
/// <summary>
|
||||
/// 其他参数
|
||||
/// </summary>
|
||||
/// <value>The parameters.</value>
|
||||
public string[] Params;
|
||||
/// <summary>
|
||||
/// 初始化默认参数(1.标题、2、用户ID、3.用户名、4.权限、5.模块编号、6.菜单ID)
|
||||
/// </summary>
|
||||
/// <param name="args">The arguments.</param>
|
||||
public DynamicPdfSignModel(string[] args)
|
||||
: base(args)
|
||||
{
|
||||
if (args.Length > 4)
|
||||
this.TypeCode = args[4];
|
||||
if (args.Length > 5)
|
||||
base.ModuleCode = args[5];
|
||||
if (args.Length > 6)
|
||||
this.StepCode = args[6];
|
||||
if (args.Length > 7)
|
||||
this.PrimaryValue = args[7];
|
||||
if (args.Length > 8)
|
||||
this.VersionCode = args[8];
|
||||
if (args.Length > 9)
|
||||
this.Type = args[9];
|
||||
if (args.Length > 10)
|
||||
this.IsFinishPage = args[10];
|
||||
if (args.Length > 11)
|
||||
{
|
||||
this.Params = new string[11];
|
||||
for (int i = 11; i < args.Length; i++)
|
||||
{
|
||||
Params[i - 11] = args[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,215 @@
|
||||
using Lskj.Business;
|
||||
using Lskj.Control.BrowserSetting;
|
||||
using Lskj.PubPdfSign.Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubPdfSign
|
||||
{
|
||||
public static class FileUploadUtil
|
||||
{
|
||||
/// <summary>
|
||||
/// 上传文件
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
public static bool UploadFile(string filePath, DynamicPdfSignModel PdfSignModel, ref UploadModel uploadModel)
|
||||
{
|
||||
bool isUpload = false;
|
||||
string postUrl = "";
|
||||
try
|
||||
{
|
||||
//获取文件信息
|
||||
FileInfo fileInfo = new FileInfo(filePath);
|
||||
byte[] fileBytes = File.ReadAllBytes(filePath);
|
||||
string fileBase64String = Convert.ToBase64String(fileBytes);
|
||||
string fileName = Guid.NewGuid().ToString().Replace("-", "") + "_" + uploadModel.FileName;
|
||||
//上传文件到服务器目录
|
||||
postUrl = "{0}Api/FileUploadApi.ashx?moduleId={1}&folder={2}&totsize={3}&position={4}&filename={5}&method={6}";
|
||||
postUrl = string.Format(postUrl, SystemInfo.Instance.OAUrl, PdfSignModel.ModuleCode, "PdfSignTemp", fileInfo.Length, 0, fileName, "DoWebUpload");
|
||||
HttpTools.setting("application/x-www-form-urlencoded", null, null);
|
||||
string result = "";
|
||||
CookieCollection cookieCollection = null;
|
||||
HttpWebResponse webResponse = HttpTools.Post(postUrl, fileBase64String, null, HttpTools.Method.POST, out cookieCollection, out result);
|
||||
if (webResponse != null && !string.IsNullOrEmpty(result))
|
||||
{
|
||||
JObject jsonObject = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(result);
|
||||
string isSuccess = jsonObject["success"] + "";
|
||||
if (isSuccess.Equals("True", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
uploadModel.FileId = jsonObject["other"] + "";
|
||||
uploadModel.Webpath = jsonObject["data"]["WebRelPath"] + "";
|
||||
isUpload = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (jsonObject.ContainsKey("msg"))
|
||||
{
|
||||
uploadModel.Msg = jsonObject["msg"] + "";
|
||||
}
|
||||
isUpload = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uploadModel.Msg = "上传请求失败";
|
||||
isUpload = false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
uploadModel.Msg = ex.Message;
|
||||
isUpload = false;
|
||||
}
|
||||
return isUpload;
|
||||
}
|
||||
public static bool UploadFileToServer(string url, string filePath, DynamicPdfSignModel PdfSignModel, ref UploadModel uploadModel)
|
||||
{
|
||||
bool isUpload = false;
|
||||
string postUrl = "";
|
||||
try
|
||||
{
|
||||
//获取文件信息
|
||||
FileInfo fileInfo = new FileInfo(filePath);
|
||||
byte[] fileBytes = File.ReadAllBytes(filePath);
|
||||
string fileBase64String = Convert.ToBase64String(fileBytes);
|
||||
//上传文件到服务器目录
|
||||
postUrl = "{0}Api/FileUploadApi.ashx?moduleId={1}&folder={2}&totsize={3}&position={4}&filename={5}&speciesno={6}&method={7}";
|
||||
postUrl = string.Format(postUrl, url, PdfSignModel.ModuleCode, "file", fileInfo.Length, 0, uploadModel.FileName, uploadModel.SpeciesNo, "DoWebUpload");
|
||||
HttpTools.setting("application/x-www-form-urlencoded", null, null);
|
||||
string result = "";
|
||||
CookieCollection cookieCollection = null;
|
||||
HttpWebResponse webResponse = HttpTools.Post(postUrl, fileBase64String, null, HttpTools.Method.POST, out cookieCollection, out result);
|
||||
if (webResponse != null && !string.IsNullOrEmpty(result))
|
||||
{
|
||||
JObject jsonObject = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(result);
|
||||
string isSuccess = jsonObject["success"] + "";
|
||||
if (isSuccess.Equals("True", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
uploadModel.FileId = jsonObject["other"] + "";
|
||||
uploadModel.Webpath = jsonObject["data"]["WebRelPath"] + "";
|
||||
isUpload = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (jsonObject.ContainsKey("msg"))
|
||||
{
|
||||
uploadModel.Msg = jsonObject["msg"] + "";
|
||||
}
|
||||
isUpload = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uploadModel.Msg = "上传请求失败";
|
||||
isUpload = false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
uploadModel.Msg = ex.Message;
|
||||
isUpload = false;
|
||||
}
|
||||
return isUpload;
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <param name="PdfSignModel"></param>
|
||||
/// <param name="uploadModel"></param>
|
||||
/// <returns></returns>
|
||||
public static bool MoveFileTo(string url, string fileId, string filepath, string newdir, DynamicPdfSignModel PdfSignModel, ref UploadModel uploadModel)
|
||||
{
|
||||
bool isUpload = false;
|
||||
string postUrl = "";
|
||||
try
|
||||
{
|
||||
//上传文件到服务器目录
|
||||
postUrl = "{0}Api/FileUploadApi.ashx?moduleId={1}&filepath={2}&newdir={3}&userid={4}&username={5}&fileid={6}&method={7}";
|
||||
postUrl = string.Format(postUrl, url, PdfSignModel.ModuleCode, filepath, newdir, "1", "管理员", fileId, "MoveFileTo");
|
||||
HttpTools.setting("application/x-www-form-urlencoded", null, null);
|
||||
string result = "";
|
||||
CookieCollection cookieCollection = null;
|
||||
HttpWebResponse webResponse = HttpTools.Post(postUrl, "", null, HttpTools.Method.POST, out cookieCollection, out result);
|
||||
if (webResponse != null && !string.IsNullOrEmpty(result))
|
||||
{
|
||||
JObject jsonObject = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(result);
|
||||
string isSuccess = jsonObject["success"] + "";
|
||||
if (isSuccess.Equals("True", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
uploadModel.FileId = jsonObject.ContainsKey("other") ? jsonObject["other"] + "" : "";
|
||||
isUpload = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (jsonObject.ContainsKey("msg"))
|
||||
{
|
||||
uploadModel.Msg = jsonObject["msg"] + "";
|
||||
}
|
||||
isUpload = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uploadModel.Msg = "移动请求失败";
|
||||
isUpload = false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
uploadModel.Msg = ex.Message;
|
||||
isUpload = false;
|
||||
}
|
||||
return isUpload;
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除文件
|
||||
/// </summary>
|
||||
/// <param name="rowItem"></param>
|
||||
/// <returns></returns>
|
||||
public static bool DeleteFile(UploadModel uploadModel)
|
||||
{
|
||||
bool isDelete = false;
|
||||
try
|
||||
{
|
||||
//删除文件
|
||||
string postUrl = "{0}Api/FileUploadApi.ashx?fileId={1}&method={2}";
|
||||
postUrl = string.Format(postUrl, SystemInfo.Instance.OAUrl, uploadModel.FileId, "DoDelete");
|
||||
HttpTools.setting("application/x-www-form-urlencoded", null, null);
|
||||
string result = "";
|
||||
CookieCollection cookieCollection = null;
|
||||
HttpWebResponse webResponse = HttpTools.Post(postUrl, "", null, HttpTools.Method.POST, out cookieCollection, out result);
|
||||
if (webResponse != null && !string.IsNullOrEmpty(result))
|
||||
{
|
||||
JObject jsonObject = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(result);
|
||||
string isSuccess = jsonObject["success"] + "";
|
||||
if (isSuccess.Equals("True", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
isDelete = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
isDelete = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
isDelete = false;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
isDelete = false;
|
||||
}
|
||||
return isDelete;
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+159
@@ -0,0 +1,159 @@
|
||||
|
||||
namespace Lskj.PubPdfSign
|
||||
{
|
||||
partial class FrmAdd
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmAdd));
|
||||
this.txt_FileName = new DevExpress.XtraEditors.TextEdit();
|
||||
this.fileNameLabel = new System.Windows.Forms.Label();
|
||||
this.txt_VersionName = new DevExpress.XtraEditors.TextEdit();
|
||||
this.versionLabel = new System.Windows.Forms.Label();
|
||||
this.editToolStrip = new System.Windows.Forms.ToolStrip();
|
||||
this.btn_Cancel = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.btn_Ok = new System.Windows.Forms.ToolStripButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.txt_FileName.Properties)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.txt_VersionName.Properties)).BeginInit();
|
||||
this.editToolStrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// txt_FileName
|
||||
//
|
||||
this.txt_FileName.Location = new System.Drawing.Point(100, 18);
|
||||
this.txt_FileName.Name = "txt_FileName";
|
||||
this.txt_FileName.Properties.ReadOnly = true;
|
||||
this.txt_FileName.Size = new System.Drawing.Size(259, 24);
|
||||
this.txt_FileName.TabIndex = 29;
|
||||
//
|
||||
// fileNameLabel
|
||||
//
|
||||
this.fileNameLabel.AutoSize = true;
|
||||
this.fileNameLabel.Location = new System.Drawing.Point(12, 23);
|
||||
this.fileNameLabel.Name = "fileNameLabel";
|
||||
this.fileNameLabel.Size = new System.Drawing.Size(82, 15);
|
||||
this.fileNameLabel.TabIndex = 28;
|
||||
this.fileNameLabel.Text = "文件名称:";
|
||||
//
|
||||
// txt_VersionName
|
||||
//
|
||||
this.txt_VersionName.Location = new System.Drawing.Point(100, 50);
|
||||
this.txt_VersionName.Name = "txt_VersionName";
|
||||
this.txt_VersionName.Properties.NullValuePrompt = "请输入版本名称";
|
||||
this.txt_VersionName.Properties.NullValuePromptShowForEmptyValue = true;
|
||||
this.txt_VersionName.Size = new System.Drawing.Size(259, 24);
|
||||
this.txt_VersionName.TabIndex = 27;
|
||||
//
|
||||
// versionLabel
|
||||
//
|
||||
this.versionLabel.AutoSize = true;
|
||||
this.versionLabel.ForeColor = System.Drawing.Color.Blue;
|
||||
this.versionLabel.Location = new System.Drawing.Point(12, 55);
|
||||
this.versionLabel.Name = "versionLabel";
|
||||
this.versionLabel.Size = new System.Drawing.Size(82, 15);
|
||||
this.versionLabel.TabIndex = 26;
|
||||
this.versionLabel.Text = "版本名称:";
|
||||
//
|
||||
// editToolStrip
|
||||
//
|
||||
this.editToolStrip.BackColor = System.Drawing.SystemColors.ControlLight;
|
||||
this.editToolStrip.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.editToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
|
||||
this.editToolStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.editToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.btn_Cancel,
|
||||
this.toolStripSeparator1,
|
||||
this.btn_Ok});
|
||||
this.editToolStrip.Location = new System.Drawing.Point(0, 91);
|
||||
this.editToolStrip.Name = "editToolStrip";
|
||||
this.editToolStrip.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
|
||||
this.editToolStrip.Size = new System.Drawing.Size(373, 32);
|
||||
this.editToolStrip.TabIndex = 25;
|
||||
this.editToolStrip.Text = "toolStrip1";
|
||||
//
|
||||
// btn_Cancel
|
||||
//
|
||||
this.btn_Cancel.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.btn_Cancel.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btn_Cancel.Image = ((System.Drawing.Image)(resources.GetObject("btn_Cancel.Image")));
|
||||
this.btn_Cancel.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.btn_Cancel.Name = "btn_Cancel";
|
||||
this.btn_Cancel.Size = new System.Drawing.Size(54, 29);
|
||||
this.btn_Cancel.Text = "取消";
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 32);
|
||||
//
|
||||
// btn_Ok
|
||||
//
|
||||
this.btn_Ok.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.btn_Ok.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btn_Ok.Image = ((System.Drawing.Image)(resources.GetObject("btn_Ok.Image")));
|
||||
this.btn_Ok.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.btn_Ok.Name = "btn_Ok";
|
||||
this.btn_Ok.Size = new System.Drawing.Size(54, 29);
|
||||
this.btn_Ok.Text = "确定";
|
||||
//
|
||||
// FrmAdd
|
||||
//
|
||||
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Appearance.Options.UseBackColor = true;
|
||||
this.Appearance.Options.UseFont = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(373, 123);
|
||||
this.Controls.Add(this.txt_FileName);
|
||||
this.Controls.Add(this.fileNameLabel);
|
||||
this.Controls.Add(this.txt_VersionName);
|
||||
this.Controls.Add(this.versionLabel);
|
||||
this.Controls.Add(this.editToolStrip);
|
||||
this.Name = "FrmAdd";
|
||||
this.Text = "模板名称";
|
||||
((System.ComponentModel.ISupportInitialize)(this.txt_FileName.Properties)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.txt_VersionName.Properties)).EndInit();
|
||||
this.editToolStrip.ResumeLayout(false);
|
||||
this.editToolStrip.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.TextEdit txt_FileName;
|
||||
private System.Windows.Forms.Label fileNameLabel;
|
||||
private DevExpress.XtraEditors.TextEdit txt_VersionName;
|
||||
private System.Windows.Forms.Label versionLabel;
|
||||
private System.Windows.Forms.ToolStrip editToolStrip;
|
||||
private System.Windows.Forms.ToolStripButton btn_Cancel;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||
private System.Windows.Forms.ToolStripButton btn_Ok;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
using Lskj.Control;
|
||||
using Lskj.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubPdfSign
|
||||
{
|
||||
public partial class FrmAdd : BaseForm
|
||||
{
|
||||
public FrmAdd()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Load += OnFrmAddLoad;
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化控件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnFrmAddLoad(object sender, EventArgs e)
|
||||
{
|
||||
this.btn_Ok.Click += OnBtnOkClick;
|
||||
this.btn_Cancel.Click += OnBtnCancelClick;
|
||||
}
|
||||
/// <summary>
|
||||
/// 取消
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnCancelClick(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
this.Close();
|
||||
}
|
||||
/// <summary>
|
||||
/// 确定
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnOkClick(object sender, EventArgs e)
|
||||
{
|
||||
string selectSql = $"select id from P_SignTempTable where versionName = '{VersionName}'";
|
||||
string id = SqlHelper.ExecuteScalar(selectSql) + "";
|
||||
if (string.IsNullOrWhiteSpace(VersionName))
|
||||
{
|
||||
MessageUtil.Show("版本名称不能为空");
|
||||
return;
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(id))
|
||||
{
|
||||
MessageUtil.Show("该版本名称已存在,请重新输入");
|
||||
return;
|
||||
}
|
||||
DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
/// <summary>
|
||||
/// 文件名
|
||||
/// </summary>
|
||||
public string FileName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txt_FileName.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txt_FileName.Text = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 文件版本
|
||||
/// </summary>
|
||||
public string VersionName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.txt_VersionName.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.txt_VersionName.Text = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="editToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="btn_Cancel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="btn_Ok.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
|
||||
namespace Lskj.PubPdfSign
|
||||
{
|
||||
partial class FrmAddSign
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tabControl = new DevExpress.XtraTab.XtraTabControl();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tabControl)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tabControl
|
||||
//
|
||||
this.tabControl.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.tabControl.BorderStylePage = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tabControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.tabControl.Name = "tabControl";
|
||||
this.tabControl.Size = new System.Drawing.Size(1116, 631);
|
||||
this.tabControl.TabIndex = 6;
|
||||
//
|
||||
// FrmAddSign
|
||||
//
|
||||
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Appearance.Options.UseBackColor = true;
|
||||
this.Appearance.Options.UseFont = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1116, 631);
|
||||
this.Controls.Add(this.tabControl);
|
||||
this.Name = "FrmAddSign";
|
||||
this.Text = "审核签章";
|
||||
((System.ComponentModel.ISupportInitialize)(this.tabControl)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public DevExpress.XtraTab.XtraTabControl tabControl;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,602 @@
|
||||
using DevExpress.XtraTab;
|
||||
using iTextSharp.text.pdf;
|
||||
using Lskj.Business;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Control;
|
||||
using Lskj.Control.Model;
|
||||
using Lskj.Model;
|
||||
using Lskj.PubPdfSign.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubPdfSign
|
||||
{
|
||||
public partial class FrmAddSign : BaseForm
|
||||
{
|
||||
public DynamicPdfSignModel PdfSignModel;
|
||||
public FrmAddSign()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.SizeChanged += OnSizeChanged;
|
||||
this.tabControl.SelectedPageChanged += OnSelectedPageChanged;
|
||||
this.Load += OnFrmAddSignLoad;
|
||||
}
|
||||
private void OnFrmAddSignLoad(object sender, EventArgs e)
|
||||
{
|
||||
if (PdfSignModel.Type.Equals("2"))
|
||||
{
|
||||
this.Opacity = 0;
|
||||
this.ShowInTaskbar = false;
|
||||
}
|
||||
WaitForm.ShowForm();
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(PdfSignModel.ModuleCode))
|
||||
{
|
||||
MessageUtil.Show("配置错误,模块编号不能为空");
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(PdfSignModel.VersionCode))
|
||||
{
|
||||
MessageUtil.Show("配置错误,签署版本不能为空");
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(PdfSignModel.PrimaryValue))
|
||||
{
|
||||
MessageUtil.Show("配置错误,签署单据不能为空");
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(PdfSignModel.StepCode))
|
||||
{
|
||||
MessageUtil.Show("配置错误,签署步骤不能为空");
|
||||
return;
|
||||
}
|
||||
ModuleModel moduleModel = new ModuleModel(MainImpl.GetSystemdllTab(PdfSignModel.ModuleCode));
|
||||
string paimaryKey = BaseImpl.GetBasePrimaryKey(PdfSignModel.ModuleCode);
|
||||
string stepUsersSql = $"select crm_htp_examinename from {moduleModel.MenuTable} where {paimaryKey} = '{PdfSignModel.PrimaryValue}'";
|
||||
|
||||
string stepUsers = BaseImpl.GetResult(stepUsersSql) + "";
|
||||
string allStepSql = $"select *,'' as signUser from p_systemdlltabflowtypestep where typecode = '{PdfSignModel.ModuleCode}' order by stepCode";
|
||||
DataTable allStepTable = BaseImpl.GetDataTableResult(allStepSql);
|
||||
if (allStepTable == null || allStepTable.Rows.Count == 0)
|
||||
{
|
||||
MessageUtil.Show("配置错误,流转步骤不能为空");
|
||||
return;
|
||||
}
|
||||
int signStepCode = Convert.ToInt32(PdfSignModel.StepCode);
|
||||
int maxStepCode = Convert.ToInt32(allStepTable.Rows[allStepTable.Rows.Count - 1]["stepCode"] + "");
|
||||
bool isFinishStep = false;
|
||||
string[] stepUserArray = stepUsers.Trim().TrimStart(',').TrimEnd(',').Split(',');
|
||||
bool isNext = false;
|
||||
for (int i = 0; i < allStepTable.Rows.Count; i++)
|
||||
{
|
||||
DataRow stepRow = allStepTable.Rows[i];
|
||||
if (stepUserArray.Length > i)
|
||||
{
|
||||
if (isNext)
|
||||
{
|
||||
stepRow["signUser"] = stepUserArray[i - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
stepRow["signUser"] = stepUserArray[i];
|
||||
}
|
||||
}
|
||||
isNext = false;
|
||||
DataRow nextStepRow = null;
|
||||
if (i + 1 < allStepTable.Rows.Count)
|
||||
{
|
||||
nextStepRow = allStepTable.Rows[i + 1];
|
||||
}
|
||||
int stepCode = Convert.ToInt32(stepRow["stepCode"] + "");
|
||||
if (stepCode == maxStepCode)
|
||||
{
|
||||
isFinishStep = true;
|
||||
signStepCode = stepCode;
|
||||
break;
|
||||
}
|
||||
bool canSign = CanSign(stepRow, nextStepRow, ref isNext);
|
||||
if (canSign)
|
||||
{
|
||||
signStepCode = stepCode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
string allFileSql = $"select * from P_fm_FileTab where dllcoid = '{PdfSignModel.ModuleCode}' and parentid =(select dirid from P_fm_DirectoryTab where PID = '{PdfSignModel.PrimaryValue}')";
|
||||
DataTable allFileTable = BaseImpl.GetDataTableResult(allFileSql);
|
||||
string selectSql = $"select * from P_SignLocationTable where mainId = '{PdfSignModel.VersionCode}'";
|
||||
DataTable allSignTable = BaseImpl.GetDataTableResult(selectSql);
|
||||
List<DataRow> signRows = allSignTable.Rows.Cast<DataRow>().Where(n => !string.IsNullOrEmpty((n["stepCode"] + "")) && !(n["stepCode"] + "").Equals("0") && !(n["stepCode"] + "").Equals("9999") && (Convert.ToInt32(n["stepCode"] + "") <= Convert.ToInt32(signStepCode))).ToList();
|
||||
List<DataRow> otherSignRows = allSignTable.Rows.Cast<DataRow>().Where(n => string.IsNullOrEmpty(n["stepCode"] + "") || (n["stepCode"] + "").Equals("0") || (n["stepCode"] + "").Equals("9999")).ToList();
|
||||
if (allFileTable == null || allFileTable.Rows.Count == 0)
|
||||
{
|
||||
MessageUtil.Show("没有查询到需要签署的文件");
|
||||
return;
|
||||
}
|
||||
if (signRows == null || signRows.Count == 0)
|
||||
{
|
||||
MessageUtil.Show("没有需要签署的步骤");
|
||||
return;
|
||||
}
|
||||
string tempDirectory = $"{Application.StartupPath}\\PdfSign\\PdfFileTemp";
|
||||
if (Directory.Exists(tempDirectory))
|
||||
{
|
||||
Directory.Delete(tempDirectory, true);
|
||||
}
|
||||
for (int i = 0; i < allFileTable.Rows.Count; i++)
|
||||
{
|
||||
bool canSign = true;
|
||||
DataRow fileRow = allFileTable.Rows[i];
|
||||
string fileId = fileRow["fileId"] + "";
|
||||
string fileName = fileRow["sName"] + "";
|
||||
if (fileName.Contains("技术更改通知单"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
string speciesno = fileRow["speciesno"] + "";
|
||||
string parentid = fileRow["parentid"] + "";
|
||||
int.TryParse(fileRow["signed"] + "", out int signed);
|
||||
string savePath = $"{Application.StartupPath}\\PdfSign\\PdfFileTemp\\saveSignTempFile{i}.pdf";
|
||||
|
||||
string fileWebPath = fileRow["webPath"] + "";
|
||||
string fileUrl = fileWebPath.StartsWith("http") ? fileWebPath : SystemInfo.Instance.OAUrl + fileWebPath;
|
||||
string defaultDownPath = $"{Application.StartupPath}\\PdfSign\\PdfFileTemp\\addSignTempFile.pdf";
|
||||
using (WebClient webClient = new WebClient())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(Path.GetDirectoryName(defaultDownPath)))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(defaultDownPath));
|
||||
}
|
||||
File.Delete(defaultDownPath);
|
||||
for (int j = 0; j < 6; j++)
|
||||
{
|
||||
fileUrl = HttpUtility.UrlDecode(fileUrl);
|
||||
}
|
||||
webClient.DownloadFile(fileUrl, defaultDownPath);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
if (!File.Exists(defaultDownPath))
|
||||
{
|
||||
MessageUtil.Show("文件下载失败");
|
||||
return;
|
||||
}
|
||||
if (!Directory.Exists(Path.GetDirectoryName(savePath)))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(savePath));
|
||||
}
|
||||
File.Delete(savePath);
|
||||
using (FileStream fileStream = new FileStream(savePath, FileMode.Create, FileAccess.ReadWrite))
|
||||
{
|
||||
using (PdfReader reader = new PdfReader(defaultDownPath))
|
||||
{
|
||||
using (PdfStamper stamper = new PdfStamper(reader, fileStream))
|
||||
{
|
||||
for (int j = 0; j < signRows.Count; j++)
|
||||
{
|
||||
DataRow signRow = signRows[j];
|
||||
DataRow dataRow = allStepTable.Rows.Cast<DataRow>().Where(n => (n["stepCode"] + "").Equals(signRow["stepCode"] + "")).FirstOrDefault();
|
||||
if (dataRow != null)
|
||||
{
|
||||
string userId = "";
|
||||
if (Convert.ToInt32(signRow["stepCode"] + "") < Convert.ToInt32(PdfSignModel.StepCode))
|
||||
{
|
||||
userId = dataRow["signUser"] + "";
|
||||
}
|
||||
else
|
||||
{
|
||||
userId = ERPInfo.Instance.UserId;
|
||||
}
|
||||
string userSignDownPath = $"{Application.StartupPath}\\PdfSign\\PdfFileTemp\\userSignTempImage.png";
|
||||
if (!GetSignUser(userSignDownPath, userId))
|
||||
{
|
||||
MessageUtil.Show("获取签名失败");
|
||||
canSign = false;
|
||||
break;
|
||||
}
|
||||
int pageNum = Convert.ToInt32(signRow["pageNum"] + "");
|
||||
float absoluteY = (float)Convert.ToDouble(signRow["absoluteY"] + "");
|
||||
float absoluteX = (float)Convert.ToDouble(signRow["absoluteX"] + "");
|
||||
float pdfImageWidth = (float)Convert.ToDouble(signRow["pdfImageWidth"] + "");
|
||||
float pdfImageHeight = (float)Convert.ToDouble(signRow["pdfImageHeight"] + "");
|
||||
|
||||
int readPageNum = reader.NumberOfPages;
|
||||
PdfContentByte pdfContentByte = stamper.GetOverContent(pageNum);//获取内容
|
||||
using (Stream inputImageStream = new FileStream(userSignDownPath, FileMode.Open, FileAccess.Read, FileShare.Read))
|
||||
{
|
||||
iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(inputImageStream);//获取图片
|
||||
image.ScaleAbsolute(pdfImageWidth, pdfImageHeight);//设置图片比例
|
||||
image.SetAbsolutePosition(absoluteX, absoluteY);//设置图片的绝对位置
|
||||
pdfContentByte.AddImage(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isFinishStep)
|
||||
{
|
||||
foreach (DataRow otherSignRow in otherSignRows)
|
||||
{
|
||||
int pageNum = Convert.ToInt32(otherSignRow["pageNum"] + "");
|
||||
float absoluteY = (float)Convert.ToDouble(otherSignRow["absoluteY"] + "");
|
||||
float absoluteX = (float)Convert.ToDouble(otherSignRow["absoluteX"] + "");
|
||||
float pdfImageWidth = (float)Convert.ToDouble(otherSignRow["pdfImageWidth"] + "");
|
||||
float pdfImageHeight = (float)Convert.ToDouble(otherSignRow["pdfImageHeight"] + "");
|
||||
int readPageNum = reader.NumberOfPages;
|
||||
PdfContentByte pdfContentByte = stamper.GetOverContent(pageNum);//获取内容
|
||||
|
||||
string signInfo = (otherSignRow["pdfAdditionalUrl"] + "").Trim();
|
||||
if ((otherSignRow["stepCode"] + "").Equals("9999"))
|
||||
{
|
||||
signInfo = "@select convert(varchar,getdate(),23)";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(signInfo))
|
||||
{
|
||||
if (signInfo.StartsWith("@"))
|
||||
{
|
||||
try
|
||||
{
|
||||
string addInfo = BaseImpl.GetResult(signInfo.TrimStart('@')) + "";
|
||||
using (Bitmap bitmap = new Bitmap(150, 50))
|
||||
{
|
||||
using (Graphics graphics = Graphics.FromImage(bitmap))
|
||||
{
|
||||
graphics.Clear(Color.Transparent);
|
||||
StringFormat stringFormat = new StringFormat
|
||||
{
|
||||
Alignment = StringAlignment.Center,
|
||||
LineAlignment = StringAlignment.Center
|
||||
};
|
||||
RectangleF rect = new RectangleF(0, 0, 150, 50);
|
||||
graphics.DrawString(addInfo, new Font("微软雅黑", 16, FontStyle.Regular), new SolidBrush(Color.Black), rect, stringFormat);
|
||||
}
|
||||
using (MemoryStream memoryStream = new MemoryStream())
|
||||
{
|
||||
bitmap.Save(memoryStream, ImageFormat.Png);
|
||||
iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(memoryStream.ToArray());//获取图片
|
||||
image.ScaleAbsolute(pdfImageWidth, pdfImageHeight);//设置图片比例
|
||||
image.SetAbsolutePosition(absoluteX, absoluteY);//设置图片的绝对位置
|
||||
pdfContentByte.AddImage(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
canSign = false;
|
||||
MessageUtil.Show($"添加自定义文本异常:{ex.Message}");
|
||||
}
|
||||
}
|
||||
else if (signInfo.StartsWith("http", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
try
|
||||
{
|
||||
string otherDownPath = $"{Application.StartupPath}\\PdfSign\\PdfFileTemp\\otherSignTemp.png";
|
||||
using (WebClient webClient = new WebClient())
|
||||
{
|
||||
if (!Directory.Exists(Path.GetDirectoryName(otherDownPath)))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(otherDownPath));
|
||||
}
|
||||
File.Delete(otherDownPath);
|
||||
for (int j = 0; j < 6; j++)
|
||||
{
|
||||
signInfo = HttpUtility.UrlDecode(signInfo);
|
||||
}
|
||||
webClient.DownloadFile(signInfo, otherDownPath);
|
||||
}
|
||||
using (Stream stream = new FileStream(otherDownPath, FileMode.Open, FileAccess.Read, FileShare.Read))
|
||||
{
|
||||
iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(stream);//获取图片
|
||||
image.ScaleAbsolute(pdfImageWidth, pdfImageHeight);//设置图片比例
|
||||
image.SetAbsolutePosition(absoluteX, absoluteY);//设置图片的绝对位置
|
||||
pdfContentByte.AddImage(image);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
canSign = false;
|
||||
MessageUtil.Show($"签名添加异常:{ex.Message}\r\nUrl:{signInfo}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isFinishStep && PdfSignModel.Type.Equals("2"))
|
||||
{
|
||||
DataRow dataRow = BaseImpl.GetDataRowResult("select top 1 * from p_systemtab");
|
||||
string newfileOAUrl = dataRow.Table.Columns.Contains("fileOAUrl") ? dataRow["fileOAUrl"] + "" : "";
|
||||
|
||||
//终审移动文件到历史文件夹
|
||||
if (!string.IsNullOrEmpty(newfileOAUrl))
|
||||
{
|
||||
string baseSpeciesNo = speciesno.Length >= 6 ? speciesno.Substring(0, 6) : "";
|
||||
int revIndex = fileName.IndexOf("Rev", StringComparison.OrdinalIgnoreCase);
|
||||
string baseFileName = revIndex > 0 ? fileName.Substring(0, revIndex) : "";
|
||||
string baseRev = revIndex > 0 ? fileName.Substring(revIndex + 3, 4) : "";
|
||||
|
||||
List<string> fileids = new List<string>();
|
||||
#region 老文件判断
|
||||
string selectsql = $"SELECT * FROM P_FileSpeciesInfoTab WHERE LEFT(speciesno, 6) = '{baseSpeciesNo}' and (vname = '{fileName}' or (SUBSTRING(vname, 1, CHARINDEX('Rev', vname) - 1) = '{baseFileName}' and SUBSTRING(vname, CHARINDEX('Rev', vname)+3,4) <> '{baseRev}')) and isnull(isMove,'1') = '1'";
|
||||
DataTable oldmMoveFileTable = BaseImpl.GetDataTableResult(selectsql);
|
||||
foreach (DataRow item in oldmMoveFileTable.Rows)
|
||||
{
|
||||
if ((item["vname"] + "").Contains("技术更改通知单"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
UploadModel moveModel = new UploadModel();
|
||||
string filePath = BaseImpl.GetResult($"select lserp_xt01.[dbo].[fun_fm_getAbsolutePath]({item["fileId"]})") + "";
|
||||
string newDir = BaseImpl.GetResult($"select moveNewDir from p_systemtab") + "";
|
||||
string newFilePath = filePath;
|
||||
if (!string.IsNullOrEmpty(newFilePath))
|
||||
{
|
||||
// 找到第一个斜杠的位置
|
||||
int firstSlashIndex = newFilePath.IndexOf('/');
|
||||
if (firstSlashIndex >= 0)
|
||||
{
|
||||
newFilePath = newFilePath.Substring(firstSlashIndex + 1);
|
||||
}
|
||||
int secondSlashIndex = newFilePath.IndexOf('/');
|
||||
if (secondSlashIndex >= 0)
|
||||
{
|
||||
newFilePath = newFilePath.Substring(secondSlashIndex + 1);
|
||||
}
|
||||
|
||||
newFilePath = Path.GetDirectoryName(newFilePath);
|
||||
|
||||
newDir = $"{newDir}\\{newFilePath}";
|
||||
bool isMove = FileUploadUtil.MoveFileTo(newfileOAUrl, item["fileId"] + "", filePath, newDir, PdfSignModel, ref moveModel);
|
||||
//插入日志
|
||||
string logSql = $"insert into P_UploadFileLogTab (step,msg,mainKey,date) values ('移动文件:{item["fileId"] + ""}到历史文件夹','{isMove},{moveModel.Msg}','{PdfSignModel.PrimaryValue}','{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}')";
|
||||
BaseImpl.ExecSqlValue(logSql);
|
||||
if (isMove)
|
||||
{
|
||||
fileids.Add(item["fileId"] + "");
|
||||
string moveWebpath = BaseImpl.GetResult($"select webpath from lserp_xt01.[dbo].[p_fm_filetab] where fileid = '{item["fileId"]}'") + "";
|
||||
BaseImpl.ExecSqlValue($"update P_FileSpeciesInfoTab set isMove = '2' where fileId = '{item["fileId"]}'");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
string sql = $"SELECT * FROM p_fm_signFileTab WHERE LEFT(speciesno, 6) = '{baseSpeciesNo}' and (sname = '{fileName}' or (SUBSTRING(sName, 1, CHARINDEX('Rev', sName) - 1) = '{baseFileName}' and SUBSTRING(sName, CHARINDEX('Rev', sName)+3,4) <> '{baseRev}')) and isMove = '1'";
|
||||
//if (!string.IsNullOrEmpty(sql))
|
||||
//{
|
||||
// Clipboard.SetText(sql);
|
||||
//}
|
||||
DataTable moveFileTable = BaseImpl.GetDataTableResult(sql);
|
||||
foreach (DataRow item in moveFileTable.Rows)
|
||||
{
|
||||
if (fileids.Contains(item["fileId"] + ""))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ((item["sname"] + "").Contains("技术更改通知单"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
UploadModel moveModel = new UploadModel();
|
||||
string filePath = BaseImpl.GetResult($"select lserp_xt01.[dbo].[fun_fm_getAbsolutePath]({item["fileId"]})") + "";
|
||||
string newDir = BaseImpl.GetResult($"select moveNewDir from p_systemtab") + "";
|
||||
string newFilePath = filePath;
|
||||
if (!string.IsNullOrEmpty(newFilePath))
|
||||
{
|
||||
// 找到第一个斜杠的位置
|
||||
int firstSlashIndex = newFilePath.IndexOf('/');
|
||||
if (firstSlashIndex >= 0)
|
||||
{
|
||||
newFilePath = newFilePath.Substring(firstSlashIndex + 1);
|
||||
}
|
||||
int secondSlashIndex = newFilePath.IndexOf('/');
|
||||
if (secondSlashIndex >= 0)
|
||||
{
|
||||
newFilePath = newFilePath.Substring(secondSlashIndex + 1);
|
||||
}
|
||||
newFilePath = Path.GetDirectoryName(newFilePath);
|
||||
newDir = $"{newDir}\\{newFilePath}";
|
||||
bool isMove = FileUploadUtil.MoveFileTo(newfileOAUrl, item["fileId"] + "", filePath, newDir, PdfSignModel, ref moveModel);
|
||||
//插入日志
|
||||
string logSql = $"insert into P_UploadFileLogTab (step,msg,mainKey,date) values ('移动文件:{item["fileId"] + ""}到历史文件夹','{isMove},{moveModel.Msg}','{PdfSignModel.PrimaryValue}','{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}')";
|
||||
BaseImpl.ExecSqlValue(logSql);
|
||||
if (isMove)
|
||||
{
|
||||
string moveWebpath = BaseImpl.GetResult($"select webpath from lserp_xt01.[dbo].[p_fm_filetab] where fileid = '{item["fileId"]}'") + "";
|
||||
BaseImpl.ExecSqlValue($"update p_fm_SignFileTab set isMove = '2',webpath = '{moveWebpath}' where fileId = '{item["fileId"]}'");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//先上传到新的服务器
|
||||
if (!string.IsNullOrEmpty(newfileOAUrl))
|
||||
{
|
||||
UploadModel uploadModel = new UploadModel() { FileName = fileName, SpeciesNo = speciesno };
|
||||
bool isUpload = FileUploadUtil.UploadFileToServer(newfileOAUrl, savePath, PdfSignModel, ref uploadModel);
|
||||
//插入日志
|
||||
string logSql = $"insert into P_UploadFileLogTab (step,msg,mainKey,date) values ('上传文件到终审服务器','{isUpload},{uploadModel.Msg}','{PdfSignModel.PrimaryValue}','{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}')";
|
||||
BaseImpl.ExecSqlValue(logSql);
|
||||
if (isUpload)
|
||||
{
|
||||
string primaryKey = BaseImpl.GetResult($"select pid from p_fm_directorytab where dirid = '{parentid}'") + "";
|
||||
BaseImpl.ExecSqlValue($"update lserp_xt01.[dbo].[p_fm_filetab] set primaryKey = '{primaryKey}',datetime = '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}' where fileId = '{uploadModel.FileId}'");
|
||||
BaseImpl.ExecSqlValue($"delete from p_fm_SignFileTab where fileId = '{uploadModel.FileId}'");
|
||||
BaseImpl.ExecSqlValue($"insert into p_fm_SignFileTab (fileId,sName,webPath,speciesno,primaryKey) values ('{uploadModel.FileId}','{uploadModel.FileName}','{uploadModel.Webpath}','{uploadModel.SpeciesNo}','{primaryKey}')");
|
||||
}
|
||||
else
|
||||
{
|
||||
canSign = false;
|
||||
MessageUtil.Show($"文件上传失败,{uploadModel.Msg}");
|
||||
}
|
||||
if (isUpload)
|
||||
{
|
||||
UploadModel deleteModel = new UploadModel() { FileId = fileId };
|
||||
bool isDelete = FileUploadUtil.DeleteFile(deleteModel);
|
||||
//插入日志
|
||||
string deleteLogSql = $"insert into P_UploadFileLogTab (step,msg,mainKey,date) values ('删除原始文件fileId:{fileId}','{isDelete},{deleteModel.Msg}','{PdfSignModel.PrimaryValue}','{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}')";
|
||||
BaseImpl.ExecSqlValue(deleteLogSql);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageUtil.Show("文件上传失败,上传地址异常");
|
||||
}
|
||||
}
|
||||
if (PdfSignModel.Type.Equals("1") || PdfSignModel.Type.Equals("2"))
|
||||
{
|
||||
if (canSign && signed <= signStepCode)
|
||||
{
|
||||
BaseImpl.ExecSqlValue($"update P_fm_FileTab set signed = '{PdfSignModel.StepCode}' where fileId = '{fileId}'");
|
||||
}
|
||||
}
|
||||
//添加预览页签
|
||||
if (PdfSignModel.Type.Equals("1"))
|
||||
{
|
||||
XtraTabPage xtraTabPage = new XtraTabPage();
|
||||
xtraTabPage.Text = fileName;
|
||||
FrmWebBrowser frmWebBrowser = new FrmWebBrowser();
|
||||
frmWebBrowser.FrmLoad(savePath);
|
||||
frmWebBrowser.Dock = DockStyle.Fill;
|
||||
xtraTabPage.Controls.Add(frmWebBrowser);
|
||||
xtraTabPage.Tag = frmWebBrowser;
|
||||
tabControl.TabPages.Add(xtraTabPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show($"签章异常:{ex.Message}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
WaitForm.HideForm();
|
||||
if (PdfSignModel.Type.Equals("2"))
|
||||
{
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
this.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 判断是否可以签章
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool CanSign(DataRow stepRow, DataRow nextStepRow, ref bool isNext)
|
||||
{
|
||||
bool canSign = true;
|
||||
int signStepCode = Convert.ToInt32(PdfSignModel.StepCode);
|
||||
int stepCode = Convert.ToInt32(stepRow["stepCode"] + "");
|
||||
string autoStep = stepRow["autoStep"] + "";
|
||||
string sameAudited = stepRow["sameAudited"] + "";
|
||||
if (stepCode >= signStepCode)
|
||||
{
|
||||
if (autoStep.Equals("1") && nextStepRow != null && (nextStepRow["autoStep"] + "").Equals("1"))
|
||||
{
|
||||
canSign = false;
|
||||
isNext = true;
|
||||
}
|
||||
if (sameAudited.Equals("1") && nextStepRow != null && (nextStepRow["sameAudited"] + "").Equals("1"))
|
||||
{
|
||||
canSign = false;
|
||||
isNext = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
canSign = false;
|
||||
}
|
||||
return canSign;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取签章人员
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool GetSignUser(string savePath, string userId)
|
||||
{
|
||||
bool isDownLoad = false;
|
||||
if (!string.IsNullOrEmpty(userId))
|
||||
{
|
||||
string signWebPath = BaseImpl.GetResult($"select bmp from p_employeetab where employeeid = '{userId}'") + "";
|
||||
string signUrl = signWebPath.StartsWith("http") ? signWebPath : SystemInfo.Instance.OAUrl + signWebPath;
|
||||
using (WebClient webClient = new WebClient())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(Path.GetDirectoryName(savePath)))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(savePath));
|
||||
}
|
||||
File.Delete(savePath);
|
||||
for (int j = 0; j < 6; j++)
|
||||
{
|
||||
signUrl = HttpUtility.UrlDecode(signUrl);
|
||||
}
|
||||
webClient.DownloadFile(signUrl, savePath);
|
||||
isDownLoad = true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
isDownLoad = false;
|
||||
}
|
||||
}
|
||||
if (!File.Exists(savePath))
|
||||
{
|
||||
isDownLoad = false;
|
||||
}
|
||||
}
|
||||
return isDownLoad;
|
||||
}
|
||||
/// <summary>
|
||||
/// 窗体大小改变时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnSizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
foreach (XtraTabPage xtraTabPage in tabControl.TabPages)
|
||||
{
|
||||
System.Windows.Forms.Control[] controls = xtraTabPage.Controls.Find("FrmWebBrowser", true);
|
||||
if (controls.Length > 0)
|
||||
{
|
||||
FrmWebBrowser frmWebBrowser = (FrmWebBrowser)controls[0];
|
||||
if (frmWebBrowser.cefBrowserSettings != null)
|
||||
{
|
||||
var handle = frmWebBrowser.cefBrowserSettings.GetHost().GetWindowHandle();
|
||||
frmWebBrowser.ResizeWindow(handle, this.Width, this.Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 页签改变时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnSelectedPageChanged(object sender, TabPageChangedEventArgs e)
|
||||
{
|
||||
if (e.Page.Tag != null && e.Page.Tag is FrmWebBrowser)
|
||||
{
|
||||
FrmWebBrowser frmWebBrowser = (FrmWebBrowser)e.Page.Tag;
|
||||
if (frmWebBrowser.cefBrowserSettings != null)
|
||||
{
|
||||
frmWebBrowser.ResizeWindow(frmWebBrowser.cefBrowserSettings.GetHost().GetWindowHandle(), frmWebBrowser.Width, frmWebBrowser.Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+426
@@ -0,0 +1,426 @@
|
||||
|
||||
namespace Lskj.PubPdfSign
|
||||
{
|
||||
partial class FrmDesign
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
DevExpress.XtraGrid.GridLevelNode gridLevelNode1 = new DevExpress.XtraGrid.GridLevelNode();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmDesign));
|
||||
DevExpress.XtraGrid.GridLevelNode gridLevelNode2 = new DevExpress.XtraGrid.GridLevelNode();
|
||||
this.splitMainControl = new DevExpress.XtraEditors.SplitContainerControl();
|
||||
this.gcMain = new DevExpress.XtraGrid.GridControl();
|
||||
this.gridView = new DevExpress.XtraGrid.Views.Grid.GridView();
|
||||
this.versionName = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.pdfUrl = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.botToolStrip = new System.Windows.Forms.ToolStrip();
|
||||
this.btn_Delete = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.btn_Update = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.btn_Add = new System.Windows.Forms.ToolStripButton();
|
||||
this.pdfEditorEx = new Lskj.PubPdfSign.Controls.PdfEditorEx();
|
||||
this.pl_right = new DevExpress.XtraEditors.PanelControl();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.StepControl = new DevExpress.XtraGrid.GridControl();
|
||||
this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.MenuSize = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.MenuVertical = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.Menuhorizontal = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
|
||||
this.StepName = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.pl_left = new DevExpress.XtraEditors.PanelControl();
|
||||
this.txt_offset = new DevExpress.XtraEditors.TextEdit();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMainControl)).BeginInit();
|
||||
this.splitMainControl.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gcMain)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView)).BeginInit();
|
||||
this.botToolStrip.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_right)).BeginInit();
|
||||
this.pl_right.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.StepControl)).BeginInit();
|
||||
this.contextMenuStrip.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_left)).BeginInit();
|
||||
this.pl_left.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.txt_offset.Properties)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitMainControl
|
||||
//
|
||||
this.splitMainControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitMainControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitMainControl.Name = "splitMainControl";
|
||||
this.splitMainControl.Panel1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple;
|
||||
this.splitMainControl.Panel1.Controls.Add(this.gcMain);
|
||||
this.splitMainControl.Panel1.Controls.Add(this.botToolStrip);
|
||||
this.splitMainControl.Panel1.Text = "Panel1";
|
||||
this.splitMainControl.Panel2.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple;
|
||||
this.splitMainControl.Panel2.Controls.Add(this.pdfEditorEx);
|
||||
this.splitMainControl.Panel2.Controls.Add(this.pl_right);
|
||||
this.splitMainControl.Panel2.Text = "Panel2";
|
||||
this.splitMainControl.Size = new System.Drawing.Size(1157, 526);
|
||||
this.splitMainControl.SplitterPosition = 277;
|
||||
this.splitMainControl.TabIndex = 6;
|
||||
this.splitMainControl.Text = "splitContainerControl1";
|
||||
//
|
||||
// gcMain
|
||||
//
|
||||
this.gcMain.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
gridLevelNode1.RelationName = "Level1";
|
||||
this.gcMain.LevelTree.Nodes.AddRange(new DevExpress.XtraGrid.GridLevelNode[] {
|
||||
gridLevelNode1});
|
||||
this.gcMain.Location = new System.Drawing.Point(0, 0);
|
||||
this.gcMain.MainView = this.gridView;
|
||||
this.gcMain.Name = "gcMain";
|
||||
this.gcMain.Size = new System.Drawing.Size(273, 495);
|
||||
this.gcMain.TabIndex = 18;
|
||||
this.gcMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
|
||||
this.gridView});
|
||||
//
|
||||
// gridView
|
||||
//
|
||||
this.gridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.gridView.Appearance.HeaderPanel.Options.UseFont = true;
|
||||
this.gridView.Appearance.HeaderPanel.Options.UseTextOptions = true;
|
||||
this.gridView.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
|
||||
this.gridView.Appearance.HeaderPanel.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
|
||||
this.gridView.Appearance.Preview.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.gridView.Appearance.Preview.Options.UseFont = true;
|
||||
this.gridView.Appearance.Row.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.gridView.Appearance.Row.Options.UseBackColor = true;
|
||||
this.gridView.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Flat;
|
||||
this.gridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
|
||||
this.versionName,
|
||||
this.pdfUrl});
|
||||
this.gridView.GridControl = this.gcMain;
|
||||
this.gridView.IndicatorWidth = 40;
|
||||
this.gridView.Name = "gridView";
|
||||
this.gridView.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.True;
|
||||
this.gridView.OptionsFilter.ShowAllTableValuesInCheckedFilterPopup = false;
|
||||
this.gridView.OptionsFilter.ShowAllTableValuesInFilterPopup = true;
|
||||
this.gridView.OptionsFind.FindNullPrompt = "";
|
||||
this.gridView.OptionsSelection.MultiSelect = true;
|
||||
this.gridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
|
||||
this.gridView.OptionsView.AllowHtmlDrawHeaders = true;
|
||||
this.gridView.OptionsView.ColumnAutoWidth = false;
|
||||
this.gridView.OptionsView.ColumnHeaderAutoHeight = DevExpress.Utils.DefaultBoolean.True;
|
||||
this.gridView.OptionsView.RowAutoHeight = true;
|
||||
this.gridView.OptionsView.ShowGroupPanel = false;
|
||||
this.gridView.PaintStyleName = "Skin";
|
||||
//
|
||||
// versionName
|
||||
//
|
||||
this.versionName.Caption = "版本名";
|
||||
this.versionName.FieldName = "versionName";
|
||||
this.versionName.Name = "versionName";
|
||||
this.versionName.OptionsColumn.AllowEdit = false;
|
||||
this.versionName.Visible = true;
|
||||
this.versionName.VisibleIndex = 0;
|
||||
this.versionName.Width = 139;
|
||||
//
|
||||
// pdfUrl
|
||||
//
|
||||
this.pdfUrl.Caption = "文件地址";
|
||||
this.pdfUrl.FieldName = "pdfUrl";
|
||||
this.pdfUrl.Name = "pdfUrl";
|
||||
this.pdfUrl.OptionsColumn.AllowEdit = false;
|
||||
this.pdfUrl.Width = 144;
|
||||
//
|
||||
// botToolStrip
|
||||
//
|
||||
this.botToolStrip.BackColor = System.Drawing.SystemColors.ControlLight;
|
||||
this.botToolStrip.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.botToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
|
||||
this.botToolStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.botToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.btn_Delete,
|
||||
this.toolStripSeparator1,
|
||||
this.btn_Update,
|
||||
this.toolStripSeparator2,
|
||||
this.btn_Add});
|
||||
this.botToolStrip.Location = new System.Drawing.Point(0, 495);
|
||||
this.botToolStrip.Name = "botToolStrip";
|
||||
this.botToolStrip.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
|
||||
this.botToolStrip.ShowItemToolTips = false;
|
||||
this.botToolStrip.Size = new System.Drawing.Size(273, 27);
|
||||
this.botToolStrip.TabIndex = 17;
|
||||
//
|
||||
// btn_Delete
|
||||
//
|
||||
this.btn_Delete.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.btn_Delete.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btn_Delete.Image = ((System.Drawing.Image)(resources.GetObject("btn_Delete.Image")));
|
||||
this.btn_Delete.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.btn_Delete.Name = "btn_Delete";
|
||||
this.btn_Delete.Size = new System.Drawing.Size(43, 24);
|
||||
this.btn_Delete.Text = "删除";
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 27);
|
||||
//
|
||||
// btn_Update
|
||||
//
|
||||
this.btn_Update.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.btn_Update.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btn_Update.Image = ((System.Drawing.Image)(resources.GetObject("btn_Update.Image")));
|
||||
this.btn_Update.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.btn_Update.Name = "btn_Update";
|
||||
this.btn_Update.Size = new System.Drawing.Size(43, 24);
|
||||
this.btn_Update.Text = "修改";
|
||||
//
|
||||
// toolStripSeparator2
|
||||
//
|
||||
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
||||
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 27);
|
||||
//
|
||||
// btn_Add
|
||||
//
|
||||
this.btn_Add.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.btn_Add.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btn_Add.Image = ((System.Drawing.Image)(resources.GetObject("btn_Add.Image")));
|
||||
this.btn_Add.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.btn_Add.Name = "btn_Add";
|
||||
this.btn_Add.Size = new System.Drawing.Size(43, 24);
|
||||
this.btn_Add.Text = "添加";
|
||||
//
|
||||
// pdfEditorEx
|
||||
//
|
||||
this.pdfEditorEx.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pdfEditorEx.Location = new System.Drawing.Point(0, 0);
|
||||
this.pdfEditorEx.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.pdfEditorEx.Name = "pdfEditorEx";
|
||||
this.pdfEditorEx.Size = new System.Drawing.Size(614, 522);
|
||||
this.pdfEditorEx.TabIndex = 22;
|
||||
//
|
||||
// pl_right
|
||||
//
|
||||
this.pl_right.Appearance.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pl_right.Appearance.Options.UseBackColor = true;
|
||||
this.pl_right.Controls.Add(this.groupBox1);
|
||||
this.pl_right.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.pl_right.Location = new System.Drawing.Point(614, 0);
|
||||
this.pl_right.Name = "pl_right";
|
||||
this.pl_right.Size = new System.Drawing.Size(257, 522);
|
||||
this.pl_right.TabIndex = 21;
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.StepControl);
|
||||
this.groupBox1.Controls.Add(this.pl_left);
|
||||
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.groupBox1.Location = new System.Drawing.Point(2, 2);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(253, 518);
|
||||
this.groupBox1.TabIndex = 23;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "选中批量设计";
|
||||
//
|
||||
// StepControl
|
||||
//
|
||||
this.StepControl.ContextMenuStrip = this.contextMenuStrip;
|
||||
this.StepControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
gridLevelNode2.RelationName = "Level1";
|
||||
this.StepControl.LevelTree.Nodes.AddRange(new DevExpress.XtraGrid.GridLevelNode[] {
|
||||
gridLevelNode2});
|
||||
this.StepControl.Location = new System.Drawing.Point(3, 55);
|
||||
this.StepControl.MainView = this.gridView1;
|
||||
this.StepControl.Name = "StepControl";
|
||||
this.StepControl.Size = new System.Drawing.Size(247, 460);
|
||||
this.StepControl.TabIndex = 22;
|
||||
this.StepControl.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
|
||||
this.gridView1});
|
||||
//
|
||||
// contextMenuStrip
|
||||
//
|
||||
this.contextMenuStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.MenuSize,
|
||||
this.MenuVertical,
|
||||
this.Menuhorizontal});
|
||||
this.contextMenuStrip.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip.Size = new System.Drawing.Size(125, 70);
|
||||
//
|
||||
// MenuSize
|
||||
//
|
||||
this.MenuSize.Name = "MenuSize";
|
||||
this.MenuSize.Size = new System.Drawing.Size(124, 22);
|
||||
this.MenuSize.Text = "相同宽高";
|
||||
this.MenuSize.Click += new System.EventHandler(this.OnSameSizeClick);
|
||||
//
|
||||
// MenuVertical
|
||||
//
|
||||
this.MenuVertical.Name = "MenuVertical";
|
||||
this.MenuVertical.Size = new System.Drawing.Size(124, 22);
|
||||
this.MenuVertical.Text = "水平间距";
|
||||
this.MenuVertical.Click += new System.EventHandler(this.OnHorizontalSpacingClick);
|
||||
//
|
||||
// Menuhorizontal
|
||||
//
|
||||
this.Menuhorizontal.Name = "Menuhorizontal";
|
||||
this.Menuhorizontal.Size = new System.Drawing.Size(124, 22);
|
||||
this.Menuhorizontal.Text = "垂直间距";
|
||||
this.Menuhorizontal.Click += new System.EventHandler(this.OnVerticalSpacingClick);
|
||||
//
|
||||
// gridView1
|
||||
//
|
||||
this.gridView1.Appearance.HeaderPanel.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.gridView1.Appearance.HeaderPanel.Options.UseFont = true;
|
||||
this.gridView1.Appearance.HeaderPanel.Options.UseTextOptions = true;
|
||||
this.gridView1.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
|
||||
this.gridView1.Appearance.HeaderPanel.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
|
||||
this.gridView1.Appearance.Preview.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.gridView1.Appearance.Preview.Options.UseFont = true;
|
||||
this.gridView1.Appearance.Row.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.gridView1.Appearance.Row.Options.UseBackColor = true;
|
||||
this.gridView1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Flat;
|
||||
this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
|
||||
this.StepName});
|
||||
this.gridView1.GridControl = this.StepControl;
|
||||
this.gridView1.IndicatorWidth = 40;
|
||||
this.gridView1.Name = "gridView1";
|
||||
this.gridView1.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.True;
|
||||
this.gridView1.OptionsFilter.ShowAllTableValuesInCheckedFilterPopup = false;
|
||||
this.gridView1.OptionsFilter.ShowAllTableValuesInFilterPopup = true;
|
||||
this.gridView1.OptionsFind.FindNullPrompt = "";
|
||||
this.gridView1.OptionsSelection.MultiSelect = true;
|
||||
this.gridView1.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
|
||||
this.gridView1.OptionsView.AllowHtmlDrawHeaders = true;
|
||||
this.gridView1.OptionsView.ColumnAutoWidth = false;
|
||||
this.gridView1.OptionsView.ColumnHeaderAutoHeight = DevExpress.Utils.DefaultBoolean.True;
|
||||
this.gridView1.OptionsView.RowAutoHeight = true;
|
||||
this.gridView1.OptionsView.ShowGroupPanel = false;
|
||||
this.gridView1.PaintStyleName = "Skin";
|
||||
//
|
||||
// StepName
|
||||
//
|
||||
this.StepName.Caption = "步骤名";
|
||||
this.StepName.FieldName = "StepName";
|
||||
this.StepName.Name = "StepName";
|
||||
this.StepName.OptionsColumn.AllowEdit = false;
|
||||
this.StepName.Visible = true;
|
||||
this.StepName.VisibleIndex = 0;
|
||||
this.StepName.Width = 139;
|
||||
//
|
||||
// pl_left
|
||||
//
|
||||
this.pl_left.Appearance.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pl_left.Appearance.Options.UseBackColor = true;
|
||||
this.pl_left.Controls.Add(this.txt_offset);
|
||||
this.pl_left.Controls.Add(this.label1);
|
||||
this.pl_left.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.pl_left.Location = new System.Drawing.Point(3, 18);
|
||||
this.pl_left.Name = "pl_left";
|
||||
this.pl_left.Size = new System.Drawing.Size(247, 37);
|
||||
this.pl_left.TabIndex = 20;
|
||||
//
|
||||
// txt_offset
|
||||
//
|
||||
this.txt_offset.EditValue = "2";
|
||||
this.txt_offset.Location = new System.Drawing.Point(78, 8);
|
||||
this.txt_offset.Name = "txt_offset";
|
||||
this.txt_offset.Properties.Appearance.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.txt_offset.Properties.Appearance.Options.UseFont = true;
|
||||
this.txt_offset.Size = new System.Drawing.Size(164, 20);
|
||||
this.txt_offset.TabIndex = 19;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.ForeColor = System.Drawing.Color.Blue;
|
||||
this.label1.Location = new System.Drawing.Point(8, 11);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(67, 14);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "固定偏移量";
|
||||
//
|
||||
// FrmDesign
|
||||
//
|
||||
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Appearance.Options.UseBackColor = true;
|
||||
this.Appearance.Options.UseFont = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1157, 526);
|
||||
this.Controls.Add(this.splitMainControl);
|
||||
this.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.Name = "FrmDesign";
|
||||
this.Text = "签名设计器";
|
||||
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMainControl)).EndInit();
|
||||
this.splitMainControl.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.gcMain)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView)).EndInit();
|
||||
this.botToolStrip.ResumeLayout(false);
|
||||
this.botToolStrip.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_right)).EndInit();
|
||||
this.pl_right.ResumeLayout(false);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.StepControl)).EndInit();
|
||||
this.contextMenuStrip.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_left)).EndInit();
|
||||
this.pl_left.ResumeLayout(false);
|
||||
this.pl_left.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.txt_offset.Properties)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.SplitContainerControl splitMainControl;
|
||||
public DevExpress.XtraGrid.GridControl gcMain;
|
||||
private DevExpress.XtraGrid.Views.Grid.GridView gridView;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn versionName;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn pdfUrl;
|
||||
private System.Windows.Forms.ToolStrip botToolStrip;
|
||||
private System.Windows.Forms.ToolStripButton btn_Delete;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||
private System.Windows.Forms.ToolStripButton btn_Update;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
||||
private System.Windows.Forms.ToolStripButton btn_Add;
|
||||
private Controls.PdfEditorEx pdfEditorEx;
|
||||
private DevExpress.XtraEditors.PanelControl pl_right;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.ContextMenuStrip contextMenuStrip;
|
||||
private System.Windows.Forms.ToolStripMenuItem MenuSize;
|
||||
private System.Windows.Forms.ToolStripMenuItem MenuVertical;
|
||||
private System.Windows.Forms.ToolStripMenuItem Menuhorizontal;
|
||||
public DevExpress.XtraGrid.GridControl StepControl;
|
||||
private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn StepName;
|
||||
private DevExpress.XtraEditors.PanelControl pl_left;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private DevExpress.XtraEditors.TextEdit txt_offset;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,567 @@
|
||||
using DevExpress.Utils;
|
||||
using DevExpress.XtraGrid.Views.Base;
|
||||
using DevExpress.XtraGrid.Views.Grid;
|
||||
using Lskj.Business;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Control;
|
||||
using Lskj.Control.BrowserSetting;
|
||||
using Lskj.Control.Model;
|
||||
using Lskj.Core;
|
||||
using Lskj.PubPdfSign.Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubPdfSign
|
||||
{
|
||||
public partial class FrmDesign : BaseForm
|
||||
{
|
||||
public FrmDesign()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Load += OnFrmMainLoad;
|
||||
this.FormClosed += OnFrmMainClosed;
|
||||
}
|
||||
/// <summary>
|
||||
/// 关闭窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnFrmMainClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
this.pdfEditorEx.CloseDocument();
|
||||
}
|
||||
/// <summary>
|
||||
/// model
|
||||
/// </summary>
|
||||
public DynamicPdfSignModel PdfSignModel;
|
||||
/// <summary>
|
||||
/// 外部数据源
|
||||
/// </summary>
|
||||
public DataRow SourceRow;
|
||||
/// <summary>
|
||||
/// AdapterObj
|
||||
/// </summary>
|
||||
public SqlDataAdapter AdapterObj { get; set; }
|
||||
/// <summary>
|
||||
/// 初始化控件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnFrmMainLoad(object sender, EventArgs e)
|
||||
{
|
||||
this.pdfEditorEx.EditToolStrip.Items.Add(new ToolStripSeparator());
|
||||
ToolStripButton saveSignBtn = new ToolStripButton()
|
||||
{
|
||||
Text = "保存",
|
||||
DisplayStyle = ToolStripItemDisplayStyle.Text,
|
||||
Font = new Font("微软雅黑", (float)10.8)
|
||||
};
|
||||
saveSignBtn.Click += this.pdfEditorEx.OnBtnSaveClick;
|
||||
this.pdfEditorEx.EditToolStrip.Items.Add(saveSignBtn);
|
||||
|
||||
this.pdfEditorEx.EditToolStrip.Items.Add(new ToolStripSeparator());
|
||||
ToolStripButton addSignBtn = new ToolStripButton()
|
||||
{
|
||||
Text = "添加签名",
|
||||
DisplayStyle = ToolStripItemDisplayStyle.Text,
|
||||
Font = new Font("微软雅黑", (float)10.8)
|
||||
};
|
||||
addSignBtn.Click += this.pdfEditorEx.OnBtnAddSignClick;
|
||||
this.pdfEditorEx.EditToolStrip.Items.Add(addSignBtn);
|
||||
|
||||
this.pdfEditorEx.EditToolStrip.Items.Add(new ToolStripSeparator());
|
||||
ToolStripButton aditionalBtn = new ToolStripButton()
|
||||
{
|
||||
Text = "添加附加",
|
||||
DisplayStyle = ToolStripItemDisplayStyle.Text,
|
||||
Font = new Font("微软雅黑", (float)10.8)
|
||||
};
|
||||
aditionalBtn.Click += this.OnBtnAdditionalClick;
|
||||
this.pdfEditorEx.EditToolStrip.Items.Add(aditionalBtn);
|
||||
this.btn_Add.Click += OnBtnAddClick;
|
||||
this.btn_Update.Click += OnBtnUpdateClick;
|
||||
this.btn_Delete.Click += OnBtnDeleteClick;
|
||||
this.gridView.RowClick += OnGridViewRowClick;
|
||||
this.gridView.FocusedRowObjectChanged += OnGridViewFocusedRowObjectChanged;
|
||||
this.gridView.CustomDrawCell += OnGridViewCustomDrawCell;
|
||||
this.gridView.CustomDrawRowIndicator += OnGridViewCustomDrawRowIndicator;
|
||||
|
||||
this.pdfEditorEx.OnAfterSignSaveCallback += OnAfterSignSaveCallback;
|
||||
this.pdfEditorEx.OnAfterSignAddCallback += OnAfterSignAddCallback;
|
||||
pdfEditorEx.StepTable = MainImpl.GetDataTableResult($"SELECT stepCode, stepName FROM P_systemdlltabflow WHERE typecode = '{PdfSignModel.TypeCode}' UNION ALL SELECT '9999' AS stepCode, '时间' AS stepName;");
|
||||
SetGridViewDataSource(GetAdapterResult($"select * from P_SignTempTable where typecode = '{PdfSignModel.TypeCode}'"));
|
||||
}
|
||||
/// <summary>
|
||||
/// 同步
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnSameSizeClick(object sender, EventArgs e)
|
||||
{
|
||||
Lskj.PubPdfSign.Controls.SignBox selectedSignBox = this.pdfEditorEx._selectedSignBox;
|
||||
if (selectedSignBox != null)
|
||||
{
|
||||
foreach (var rowHandle in gridView1.GetSelectedRows())
|
||||
{
|
||||
string stepName = gridView1.GetRowCellValue(rowHandle, "StepName").ToString();
|
||||
Lskj.PubPdfSign.Controls.SignBox signBox = this.pdfEditorEx._signBoxList.FirstOrDefault(s => s.StepName == stepName);
|
||||
if (signBox != null)
|
||||
{
|
||||
signBox.SignWidth = selectedSignBox.SignWidth;
|
||||
signBox.SignHeight = selectedSignBox.SignHeight;
|
||||
signBox.ParentPicBox.Width = selectedSignBox.SignWidth;
|
||||
signBox.ParentPicBox.Height = selectedSignBox.SignHeight;
|
||||
signBox.UpdateLocation();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 水平设置
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnHorizontalSpacingClick(object sender, EventArgs e)
|
||||
{
|
||||
Lskj.PubPdfSign.Controls.SignBox selectedSignBox = this.pdfEditorEx._selectedSignBox;
|
||||
if (selectedSignBox != null)
|
||||
{
|
||||
int offset = int.Parse(txt_offset.Text);
|
||||
int currentX = selectedSignBox.SignLeft;
|
||||
int lastWidth = selectedSignBox.SignWidth;
|
||||
foreach (var rowHandle in gridView1.GetSelectedRows())
|
||||
{
|
||||
string stepName = gridView1.GetRowCellValue(rowHandle, "StepName").ToString();
|
||||
if (stepName.Equals(selectedSignBox.StepName)) continue;
|
||||
Lskj.PubPdfSign.Controls.SignBox signBox = this.pdfEditorEx._signBoxList.FirstOrDefault(s => s.StepName == stepName);
|
||||
if (signBox != null)
|
||||
{
|
||||
currentX += (offset + lastWidth);
|
||||
signBox.SignLeft = currentX;
|
||||
signBox.SignTop = selectedSignBox.SignTop;
|
||||
signBox.ParentPicBox.Left = currentX;
|
||||
signBox.UpdateLocation();
|
||||
lastWidth = signBox.SignWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 垂直设置
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnVerticalSpacingClick(object sender, EventArgs e)
|
||||
{
|
||||
Lskj.PubPdfSign.Controls.SignBox selectedSignBox = this.pdfEditorEx._selectedSignBox;
|
||||
if (selectedSignBox != null)
|
||||
{
|
||||
int offset = int.Parse(txt_offset.Text);
|
||||
int currentY = selectedSignBox.SignTop;
|
||||
int lastHeight = selectedSignBox.SignHeight;
|
||||
foreach (var rowHandle in gridView1.GetSelectedRows())
|
||||
{
|
||||
string stepName = gridView1.GetRowCellValue(rowHandle, "StepName").ToString();
|
||||
if (stepName.Equals(selectedSignBox.StepName)) continue;
|
||||
Lskj.PubPdfSign.Controls.SignBox signBox = this.pdfEditorEx._signBoxList.FirstOrDefault(s => s.StepName == stepName);
|
||||
if (signBox != null)
|
||||
{
|
||||
currentY += (offset + lastHeight);
|
||||
signBox.SignTop = currentY;
|
||||
signBox.SignLeft = selectedSignBox.SignLeft;
|
||||
signBox.ParentPicBox.Top = currentY;
|
||||
signBox.UpdateLocation();
|
||||
lastHeight = signBox.SignHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存完成后
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnAfterSignSaveCallback(object sender, EventArgs e)
|
||||
{
|
||||
SetGridViewDataSource(GetAdapterResult($"select * from P_SignTempTable where typecode = '{PdfSignModel.TypeCode}'"), true);
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加完成完成后
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnAfterSignAddCallback(object sender, EventArgs e)
|
||||
{
|
||||
OnSignDesignUpd();
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除按钮点击
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnDeleteClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
int[] rowids = this.gridView.GetSelectedRows();
|
||||
if (rowids == null || rowids.Length == 0)
|
||||
{
|
||||
MessageUtil.Show("请选择需要删除的数据");
|
||||
}
|
||||
else
|
||||
{
|
||||
DialogResult result = MessageUtil.Show($"确定要删除选中{rowids.Length}条数据?", MessageBoxButtons.YesNo);
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
ArrayList localDeletes = new ArrayList();
|
||||
List<UploadModel> mList = new List<UploadModel>();
|
||||
List<string> delToPosts = new List<string>();
|
||||
foreach (int rowid in rowids)
|
||||
{
|
||||
DataRow rowData = this.gridView.GetDataRow(rowid);
|
||||
if (rowData.RowState != DataRowState.Added)
|
||||
{
|
||||
string fieldValue = rowData["id"] + "";
|
||||
string webPath = rowData["pdfUrl"] + "";
|
||||
string sqlValue = string.Format("delete from P_SignTempTable where id = '{0}' and typecode = '{1}'", fieldValue, PdfSignModel.TypeCode);
|
||||
mList.Add(new UploadModel() { FileId = fieldValue, Webpath = webPath, ExecSql = sqlValue });
|
||||
}
|
||||
else
|
||||
{
|
||||
localDeletes.Add(rowid);
|
||||
}
|
||||
}
|
||||
if (mList.Count > 0)
|
||||
{
|
||||
string hintMsg = "删除结果如下:\n";
|
||||
foreach (UploadModel uploadModel in mList)
|
||||
{
|
||||
try
|
||||
{
|
||||
string deleteSql = uploadModel.ExecSql;
|
||||
SqlHelper.ExecuteNonQuery(deleteSql);
|
||||
WaitForm.ShowForm();
|
||||
bool isDelete = FileUploadUtil.DeleteFile(uploadModel);
|
||||
WaitForm.HideForm();
|
||||
if (isDelete)
|
||||
{
|
||||
hintMsg += "记录[" + uploadModel.FileId + "]删除成功.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
hintMsg += "记录[" + uploadModel.FileId + "]删除失败,原因:" + uploadModel.Msg + "\n";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
hintMsg += "记录[" + uploadModel.FileId + "]删除失败,原因:" + ex.Message + "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (localDeletes.Count > 0)
|
||||
{
|
||||
// 删除选中且未保存的数据
|
||||
for (int i = localDeletes.Count - 1; i >= 0; i--)
|
||||
{
|
||||
this.gridView.DeleteRow((int)localDeletes[i]);
|
||||
}
|
||||
MessageUtil.Show("删除成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageUtil.Show("无法删除");
|
||||
}
|
||||
}
|
||||
SetGridViewDataSource(GetAdapterResult($"select * from P_SignTempTable where typecode = '{PdfSignModel.TypeCode}'"), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新按钮点击
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnUpdateClick(object sender, EventArgs e)
|
||||
{
|
||||
DataRow dataRow = this.gridView.GetFocusedDataRow();
|
||||
if (dataRow != null)
|
||||
{
|
||||
string fileName = Path.GetFileName(dataRow["pdfUrl"] + "");
|
||||
string versionName = dataRow["versionName"] + "";
|
||||
using (FrmAdd frmAdd = new FrmAdd())
|
||||
{
|
||||
frmAdd.ShowDialog();
|
||||
frmAdd.FileName = fileName;
|
||||
frmAdd.VersionName = versionName;
|
||||
if (frmAdd.DialogResult == DialogResult.OK)
|
||||
{
|
||||
DataTable dataTable = this.gcMain.DataSource as DataTable;
|
||||
int result = this.AdapterObj.Update(dataTable);
|
||||
SetGridViewDataSource(GetAdapterResult($"select * from P_SignTempTable where typecode = '{PdfSignModel.TypeCode}'"), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加按钮点击
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnAddClick(object sender, EventArgs e)
|
||||
{
|
||||
using (OpenFileDialog dialog = new OpenFileDialog())
|
||||
{
|
||||
dialog.Multiselect = false;//该值确定是否可以选择多个文件
|
||||
dialog.Title = "请选择文件";
|
||||
dialog.Filter = "PDF文件(*.pdf)|*.pdf";
|
||||
if (dialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
string fileFullName = dialog.FileName;
|
||||
UploadModel uploadModel = new UploadModel();
|
||||
uploadModel.FileName = Path.GetFileName(fileFullName);
|
||||
using (FrmAdd frmAdd = new FrmAdd())
|
||||
{
|
||||
frmAdd.FileName = Path.GetFileName(fileFullName);
|
||||
frmAdd.StartPosition = FormStartPosition.Manual;
|
||||
frmAdd.Location = new Point(this.Left + 50, this.Bottom - frmAdd.Height - 50);
|
||||
if (frmAdd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
uploadModel.Version = frmAdd.VersionName;
|
||||
WaitForm.ShowForm();
|
||||
bool isUpload = FileUploadUtil.UploadFile(fileFullName, PdfSignModel, ref uploadModel);
|
||||
WaitForm.HideForm();
|
||||
if (!isUpload)
|
||||
{
|
||||
MessageUtil.Show(uploadModel.Msg);
|
||||
return;
|
||||
}
|
||||
DataRow dataRow = AddGridViewRecord(uploadModel);
|
||||
try
|
||||
{
|
||||
DataTable dataTable = this.gcMain.DataSource as DataTable;
|
||||
int result = this.AdapterObj.Update(dataTable);
|
||||
SetGridViewDataSource(GetAdapterResult($"select * from P_SignTempTable where typecode = '{PdfSignModel.TypeCode}'"), true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show($"保存失败,原因:{ex.Message}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 条件附加模块
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public void OnBtnAdditionalClick(object sender, EventArgs e)
|
||||
{
|
||||
using (OpenFileDialog dialog = new OpenFileDialog())
|
||||
{
|
||||
dialog.Multiselect = false;//该值确定是否可以选择多个文件
|
||||
dialog.Title = "请选择文件";
|
||||
dialog.Filter = "图片文件 (*.bmp, *.jpg, *.jpeg, *.png, *.gif, *.tiff, *.tif, *.webp)|*.bmp;*.jpg;*.jpeg;*.png;*.gif;*.tiff;*.tif;*.webp";
|
||||
if (dialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
string fileFullName = dialog.FileName;
|
||||
UploadModel uploadModel = new UploadModel();
|
||||
uploadModel.isAdditional = true;
|
||||
uploadModel.FileName = Path.GetFileName(fileFullName);
|
||||
WaitForm.ShowForm();
|
||||
bool isUpload = FileUploadUtil.UploadFile(fileFullName, PdfSignModel, ref uploadModel);
|
||||
WaitForm.HideForm();
|
||||
if (!isUpload)
|
||||
{
|
||||
MessageUtil.Show(uploadModel.Msg);
|
||||
return;
|
||||
}
|
||||
string url = uploadModel.Webpath.StartsWith("http") ? uploadModel.Webpath : SystemInfo.Instance.OAUrl + uploadModel.Webpath;
|
||||
this.pdfEditorEx.AddSignPicControl("", url);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 点击指定行
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnGridViewRowClick(object sender, RowClickEventArgs e)
|
||||
{
|
||||
DataRow dataRow = this.gridView.GetDataRow(e.RowHandle);
|
||||
if (dataRow != null)
|
||||
{
|
||||
string versionCode = dataRow.Table.Columns.Contains("id") ? dataRow["id"] + "" : "";
|
||||
this.pdfEditorEx.VersionCode = versionCode;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 选中行改变时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnGridViewFocusedRowObjectChanged(object sender, FocusedRowObjectChangedEventArgs e)
|
||||
{
|
||||
DataRow dataRow = this.gridView.GetFocusedDataRow();
|
||||
if (dataRow != null)
|
||||
{
|
||||
string versionCode = dataRow.Table.Columns.Contains("id") ? dataRow["id"] + "" : "";
|
||||
this.pdfEditorEx.VersionCode = versionCode;
|
||||
this.pdfEditorEx.OpenLocalFile(dataRow);
|
||||
}
|
||||
this.OnSignDesignUpd();
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新右侧所有设计器值
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public void OnSignDesignUpd()
|
||||
{
|
||||
if (this.pdfEditorEx._signBoxList != null && this.pdfEditorEx._signBoxList.Count > 0)
|
||||
{
|
||||
DataTable dataTable = new DataTable();
|
||||
dataTable.Columns.Add("StepName");
|
||||
foreach (Lskj.PubPdfSign.Controls.SignBox signBox in this.pdfEditorEx._signBoxList)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(signBox.StepName))
|
||||
{
|
||||
DataRow dr = dataTable.NewRow();
|
||||
dr["StepName"] = signBox.StepName;
|
||||
dataTable.Rows.Add(dr);
|
||||
}
|
||||
}
|
||||
StepControl.DataSource = dataTable;
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 选中行颜色
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnGridViewCustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
|
||||
{
|
||||
if (e.RowHandle == gridView.FocusedRowHandle)
|
||||
{
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml("#9feb6a");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示表格序号
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnGridViewCustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
e.Appearance.TextOptions.HAlignment = HorzAlignment.Center;
|
||||
if (e.Info.IsRowIndicator)
|
||||
{
|
||||
if (e.RowHandle >= 0)
|
||||
{
|
||||
e.Info.DisplayText = (e.RowHandle + 1).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 设置数据源
|
||||
/// </summary>
|
||||
private int SetGridViewDataSource(SqlDataAdapter adapter, bool selectRowHandler = true)
|
||||
{
|
||||
if (adapter == null) return 0;
|
||||
|
||||
try
|
||||
{
|
||||
int focusedRowHandle = this.gridView.FocusedRowHandle;
|
||||
this.AdapterObj = adapter;
|
||||
DataSet dataSet = new DataSet();
|
||||
adapter.Fill(dataSet, "SetGridViewDataSource");
|
||||
SqlCommandBuilder cb = new SqlCommandBuilder(this.AdapterObj);
|
||||
DataTable dt = dataSet.Tables[0];
|
||||
this.gcMain.DataSource = dt;
|
||||
this.gridView.BestFitColumns();
|
||||
int splitPosition = versionName.Width + this.gridView.IndicatorWidth + 10;
|
||||
this.splitMainControl.SplitterPosition = splitPosition > 400 ? splitPosition : 400;
|
||||
if (selectRowHandler)
|
||||
{
|
||||
this.gridView.FocusedRowHandle = focusedRowHandle;
|
||||
}
|
||||
if (dt.Rows.Count == 0)
|
||||
{
|
||||
pdfEditorEx.CloseDocument();
|
||||
}
|
||||
return dataSet.Tables[0] != null ? dataSet.Tables[0].Rows.Count : 0;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/// <summary>
|
||||
/// 直接表格添加数据
|
||||
/// </summary>
|
||||
/// <param name="fullName"></param>
|
||||
private DataRow AddGridViewRecord(UploadModel uploadModel)
|
||||
{
|
||||
DataRow dataRow = null;
|
||||
try
|
||||
{
|
||||
DataTable dt = this.gcMain.DataSource as DataTable;
|
||||
dataRow = dt.NewRow();
|
||||
dataRow["pdfUrl"] = uploadModel.Webpath;
|
||||
dataRow["versionName"] = uploadModel.Version;
|
||||
dataRow["typecode"] = PdfSignModel.TypeCode;
|
||||
dt.Rows.Add(dataRow);
|
||||
this.gridView.UpdateCurrentRow();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
return dataRow;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取数据
|
||||
/// </summary>
|
||||
/// <param name="sqlValue"></param>
|
||||
/// <returns></returns>
|
||||
private SqlDataAdapter GetAdapterResult(string sqlValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(sqlValue)) return new SqlDataAdapter();
|
||||
return SqlHelper.ExecuteAdapter(CommandType.Text, sqlValue);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
return new SqlDataAdapter();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="botToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="btn_Delete.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="btn_Update.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="btn_Add.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="contextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>309, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+356
@@ -0,0 +1,356 @@
|
||||
|
||||
using Lskj.PubPdfSign.Controls;
|
||||
|
||||
namespace Lskj.PubPdfSign
|
||||
{
|
||||
partial class FrmUpload
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
DevExpress.XtraGrid.GridLevelNode gridLevelNode2 = new DevExpress.XtraGrid.GridLevelNode();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmUpload));
|
||||
this.splitMainControl = new DevExpress.XtraEditors.SplitContainerControl();
|
||||
this.gcMain = new DevExpress.XtraGrid.GridControl();
|
||||
this.gridView = new DevExpress.XtraGrid.Views.Grid.GridView();
|
||||
this.fileName = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.versionCode = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.versionGridLookUpEdit = new DevExpress.XtraEditors.Repository.RepositoryItemGridLookUpEdit();
|
||||
this.repositoryItemGridLookUpEdit1View = new DevExpress.XtraGrid.Views.Grid.GridView();
|
||||
this.pdfUrl = new DevExpress.XtraGrid.Columns.GridColumn();
|
||||
this.botPanel = new System.Windows.Forms.Panel();
|
||||
this.rightToolStripPanel = new System.Windows.Forms.Panel();
|
||||
this.rightToolStrip = new System.Windows.Forms.ToolStrip();
|
||||
this.btn_UpSave = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.btn_UpDelete = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.btn_UpLoad = new System.Windows.Forms.ToolStripButton();
|
||||
this.leftPanel = new System.Windows.Forms.Panel();
|
||||
this.leftToolStrip = new System.Windows.Forms.ToolStrip();
|
||||
this.btn_AddTemp = new System.Windows.Forms.ToolStripButton();
|
||||
this.pdfEditorEx = new Lskj.PubPdfSign.Controls.PdfEditorEx();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMainControl)).BeginInit();
|
||||
this.splitMainControl.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gcMain)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.versionGridLookUpEdit)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemGridLookUpEdit1View)).BeginInit();
|
||||
this.botPanel.SuspendLayout();
|
||||
this.rightToolStripPanel.SuspendLayout();
|
||||
this.rightToolStrip.SuspendLayout();
|
||||
this.leftPanel.SuspendLayout();
|
||||
this.leftToolStrip.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitMainControl
|
||||
//
|
||||
this.splitMainControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitMainControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitMainControl.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.splitMainControl.Name = "splitMainControl";
|
||||
this.splitMainControl.Panel1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple;
|
||||
this.splitMainControl.Panel1.Controls.Add(this.gcMain);
|
||||
this.splitMainControl.Panel1.Controls.Add(this.botPanel);
|
||||
this.splitMainControl.Panel1.Text = "Panel1";
|
||||
this.splitMainControl.Panel2.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple;
|
||||
this.splitMainControl.Panel2.Controls.Add(this.pdfEditorEx);
|
||||
this.splitMainControl.Panel2.Text = "Panel2";
|
||||
this.splitMainControl.Size = new System.Drawing.Size(1042, 718);
|
||||
this.splitMainControl.SplitterPosition = 397;
|
||||
this.splitMainControl.TabIndex = 7;
|
||||
this.splitMainControl.Text = "splitContainerControl1";
|
||||
//
|
||||
// gcMain
|
||||
//
|
||||
this.gcMain.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gcMain.EmbeddedNavigator.Margin = new System.Windows.Forms.Padding(4);
|
||||
gridLevelNode2.RelationName = "Level1";
|
||||
this.gcMain.LevelTree.Nodes.AddRange(new DevExpress.XtraGrid.GridLevelNode[] {
|
||||
gridLevelNode2});
|
||||
this.gcMain.Location = new System.Drawing.Point(0, 0);
|
||||
this.gcMain.MainView = this.gridView;
|
||||
this.gcMain.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.gcMain.Name = "gcMain";
|
||||
this.gcMain.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
|
||||
this.versionGridLookUpEdit});
|
||||
this.gcMain.Size = new System.Drawing.Size(393, 683);
|
||||
this.gcMain.TabIndex = 26;
|
||||
this.gcMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
|
||||
this.gridView});
|
||||
//
|
||||
// gridView
|
||||
//
|
||||
this.gridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.gridView.Appearance.HeaderPanel.Options.UseFont = true;
|
||||
this.gridView.Appearance.HeaderPanel.Options.UseTextOptions = true;
|
||||
this.gridView.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
|
||||
this.gridView.Appearance.HeaderPanel.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
|
||||
this.gridView.Appearance.Preview.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.gridView.Appearance.Preview.Options.UseFont = true;
|
||||
this.gridView.Appearance.Row.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.gridView.Appearance.Row.Options.UseBackColor = true;
|
||||
this.gridView.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Flat;
|
||||
this.gridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
|
||||
this.fileName,
|
||||
this.versionCode,
|
||||
this.pdfUrl});
|
||||
this.gridView.GridControl = this.gcMain;
|
||||
this.gridView.IndicatorWidth = 40;
|
||||
this.gridView.Name = "gridView";
|
||||
this.gridView.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.True;
|
||||
this.gridView.OptionsFilter.ShowAllTableValuesInCheckedFilterPopup = false;
|
||||
this.gridView.OptionsFilter.ShowAllTableValuesInFilterPopup = true;
|
||||
this.gridView.OptionsFind.FindNullPrompt = "";
|
||||
this.gridView.OptionsSelection.MultiSelect = true;
|
||||
this.gridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
|
||||
this.gridView.OptionsView.AllowHtmlDrawHeaders = true;
|
||||
this.gridView.OptionsView.ColumnAutoWidth = false;
|
||||
this.gridView.OptionsView.ColumnHeaderAutoHeight = DevExpress.Utils.DefaultBoolean.True;
|
||||
this.gridView.OptionsView.RowAutoHeight = true;
|
||||
this.gridView.OptionsView.ShowGroupPanel = false;
|
||||
this.gridView.PaintStyleName = "Skin";
|
||||
//
|
||||
// fileName
|
||||
//
|
||||
this.fileName.Caption = "文件名";
|
||||
this.fileName.FieldName = "fileName";
|
||||
this.fileName.Name = "fileName";
|
||||
this.fileName.OptionsColumn.AllowEdit = false;
|
||||
this.fileName.Visible = true;
|
||||
this.fileName.VisibleIndex = 0;
|
||||
this.fileName.Width = 167;
|
||||
//
|
||||
// versionCode
|
||||
//
|
||||
this.versionCode.AppearanceHeader.ForeColor = System.Drawing.Color.Blue;
|
||||
this.versionCode.AppearanceHeader.Options.UseForeColor = true;
|
||||
this.versionCode.Caption = "版本";
|
||||
this.versionCode.ColumnEdit = this.versionGridLookUpEdit;
|
||||
this.versionCode.FieldName = "versionCode";
|
||||
this.versionCode.Name = "versionCode";
|
||||
this.versionCode.Visible = true;
|
||||
this.versionCode.VisibleIndex = 1;
|
||||
this.versionCode.Width = 185;
|
||||
//
|
||||
// versionGridLookUpEdit
|
||||
//
|
||||
this.versionGridLookUpEdit.AutoHeight = false;
|
||||
this.versionGridLookUpEdit.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
|
||||
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
|
||||
this.versionGridLookUpEdit.DisplayMember = "versionName";
|
||||
this.versionGridLookUpEdit.Name = "versionGridLookUpEdit";
|
||||
this.versionGridLookUpEdit.ValueMember = "id";
|
||||
this.versionGridLookUpEdit.View = this.repositoryItemGridLookUpEdit1View;
|
||||
//
|
||||
// repositoryItemGridLookUpEdit1View
|
||||
//
|
||||
this.repositoryItemGridLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
|
||||
this.repositoryItemGridLookUpEdit1View.Name = "repositoryItemGridLookUpEdit1View";
|
||||
this.repositoryItemGridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
|
||||
this.repositoryItemGridLookUpEdit1View.OptionsView.ShowGroupPanel = false;
|
||||
//
|
||||
// pdfUrl
|
||||
//
|
||||
this.pdfUrl.Caption = "文件地址";
|
||||
this.pdfUrl.FieldName = "pdfUrl";
|
||||
this.pdfUrl.Name = "pdfUrl";
|
||||
this.pdfUrl.OptionsColumn.AllowEdit = false;
|
||||
this.pdfUrl.Width = 144;
|
||||
//
|
||||
// botPanel
|
||||
//
|
||||
this.botPanel.Controls.Add(this.rightToolStripPanel);
|
||||
this.botPanel.Controls.Add(this.leftPanel);
|
||||
this.botPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.botPanel.Location = new System.Drawing.Point(0, 683);
|
||||
this.botPanel.Name = "botPanel";
|
||||
this.botPanel.Size = new System.Drawing.Size(393, 31);
|
||||
this.botPanel.TabIndex = 25;
|
||||
//
|
||||
// rightToolStripPanel
|
||||
//
|
||||
this.rightToolStripPanel.Controls.Add(this.rightToolStrip);
|
||||
this.rightToolStripPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.rightToolStripPanel.Location = new System.Drawing.Point(116, 0);
|
||||
this.rightToolStripPanel.Name = "rightToolStripPanel";
|
||||
this.rightToolStripPanel.Size = new System.Drawing.Size(277, 31);
|
||||
this.rightToolStripPanel.TabIndex = 24;
|
||||
//
|
||||
// rightToolStrip
|
||||
//
|
||||
this.rightToolStrip.BackColor = System.Drawing.SystemColors.ControlLight;
|
||||
this.rightToolStrip.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.rightToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
|
||||
this.rightToolStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.rightToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.btn_UpSave,
|
||||
this.toolStripSeparator3,
|
||||
this.btn_UpDelete,
|
||||
this.toolStripSeparator4,
|
||||
this.btn_UpLoad});
|
||||
this.rightToolStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.rightToolStrip.Name = "rightToolStrip";
|
||||
this.rightToolStrip.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
|
||||
this.rightToolStrip.ShowItemToolTips = false;
|
||||
this.rightToolStrip.Size = new System.Drawing.Size(277, 31);
|
||||
this.rightToolStrip.TabIndex = 22;
|
||||
//
|
||||
// btn_UpSave
|
||||
//
|
||||
this.btn_UpSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.btn_UpSave.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btn_UpSave.Image = ((System.Drawing.Image)(resources.GetObject("btn_UpSave.Image")));
|
||||
this.btn_UpSave.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.btn_UpSave.Name = "btn_UpSave";
|
||||
this.btn_UpSave.Size = new System.Drawing.Size(54, 28);
|
||||
this.btn_UpSave.Text = "保存";
|
||||
//
|
||||
// toolStripSeparator3
|
||||
//
|
||||
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
||||
this.toolStripSeparator3.Size = new System.Drawing.Size(6, 31);
|
||||
//
|
||||
// btn_UpDelete
|
||||
//
|
||||
this.btn_UpDelete.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.btn_UpDelete.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btn_UpDelete.Image = ((System.Drawing.Image)(resources.GetObject("btn_UpDelete.Image")));
|
||||
this.btn_UpDelete.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.btn_UpDelete.Name = "btn_UpDelete";
|
||||
this.btn_UpDelete.Size = new System.Drawing.Size(54, 28);
|
||||
this.btn_UpDelete.Text = "删除";
|
||||
//
|
||||
// toolStripSeparator4
|
||||
//
|
||||
this.toolStripSeparator4.Name = "toolStripSeparator4";
|
||||
this.toolStripSeparator4.Size = new System.Drawing.Size(6, 31);
|
||||
//
|
||||
// btn_UpLoad
|
||||
//
|
||||
this.btn_UpLoad.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.btn_UpLoad.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btn_UpLoad.Image = ((System.Drawing.Image)(resources.GetObject("btn_UpLoad.Image")));
|
||||
this.btn_UpLoad.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.btn_UpLoad.Name = "btn_UpLoad";
|
||||
this.btn_UpLoad.Size = new System.Drawing.Size(54, 28);
|
||||
this.btn_UpLoad.Text = "上传";
|
||||
//
|
||||
// leftPanel
|
||||
//
|
||||
this.leftPanel.Controls.Add(this.leftToolStrip);
|
||||
this.leftPanel.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.leftPanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.leftPanel.Name = "leftPanel";
|
||||
this.leftPanel.Size = new System.Drawing.Size(116, 31);
|
||||
this.leftPanel.TabIndex = 23;
|
||||
//
|
||||
// leftToolStrip
|
||||
//
|
||||
this.leftToolStrip.BackColor = System.Drawing.SystemColors.ControlLight;
|
||||
this.leftToolStrip.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.leftToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
|
||||
this.leftToolStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.leftToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.btn_AddTemp});
|
||||
this.leftToolStrip.Location = new System.Drawing.Point(0, 0);
|
||||
this.leftToolStrip.Name = "leftToolStrip";
|
||||
this.leftToolStrip.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.leftToolStrip.ShowItemToolTips = false;
|
||||
this.leftToolStrip.Size = new System.Drawing.Size(116, 31);
|
||||
this.leftToolStrip.TabIndex = 24;
|
||||
//
|
||||
// btn_AddTemp
|
||||
//
|
||||
this.btn_AddTemp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.btn_AddTemp.Font = new System.Drawing.Font("Microsoft YaHei UI", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btn_AddTemp.Image = ((System.Drawing.Image)(resources.GetObject("btn_AddTemp.Image")));
|
||||
this.btn_AddTemp.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.btn_AddTemp.Name = "btn_AddTemp";
|
||||
this.btn_AddTemp.Size = new System.Drawing.Size(92, 28);
|
||||
this.btn_AddTemp.Text = "添加模板";
|
||||
//
|
||||
// pdfEditorEx
|
||||
//
|
||||
this.pdfEditorEx.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pdfEditorEx.Location = new System.Drawing.Point(0, 0);
|
||||
this.pdfEditorEx.Name = "pdfEditorEx";
|
||||
this.pdfEditorEx.Size = new System.Drawing.Size(635, 714);
|
||||
this.pdfEditorEx.TabIndex = 0;
|
||||
//
|
||||
// FrmUpload
|
||||
//
|
||||
this.Appearance.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.Appearance.Options.UseBackColor = true;
|
||||
this.Appearance.Options.UseFont = true;
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.ClientSize = new System.Drawing.Size(1042, 718);
|
||||
this.Controls.Add(this.splitMainControl);
|
||||
this.Name = "FrmUpload";
|
||||
this.Text = "文件上传";
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMainControl)).EndInit();
|
||||
this.splitMainControl.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.gcMain)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.gridView)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.versionGridLookUpEdit)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.repositoryItemGridLookUpEdit1View)).EndInit();
|
||||
this.botPanel.ResumeLayout(false);
|
||||
this.rightToolStripPanel.ResumeLayout(false);
|
||||
this.rightToolStripPanel.PerformLayout();
|
||||
this.rightToolStrip.ResumeLayout(false);
|
||||
this.rightToolStrip.PerformLayout();
|
||||
this.leftPanel.ResumeLayout(false);
|
||||
this.leftPanel.PerformLayout();
|
||||
this.leftToolStrip.ResumeLayout(false);
|
||||
this.leftToolStrip.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DevExpress.XtraEditors.SplitContainerControl splitMainControl;
|
||||
public DevExpress.XtraGrid.GridControl gcMain;
|
||||
private DevExpress.XtraGrid.Views.Grid.GridView gridView;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn fileName;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn versionCode;
|
||||
private DevExpress.XtraEditors.Repository.RepositoryItemGridLookUpEdit versionGridLookUpEdit;
|
||||
private DevExpress.XtraGrid.Views.Grid.GridView repositoryItemGridLookUpEdit1View;
|
||||
private DevExpress.XtraGrid.Columns.GridColumn pdfUrl;
|
||||
private System.Windows.Forms.Panel botPanel;
|
||||
private System.Windows.Forms.Panel rightToolStripPanel;
|
||||
private System.Windows.Forms.ToolStrip rightToolStrip;
|
||||
private System.Windows.Forms.ToolStripButton btn_UpSave;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
|
||||
private System.Windows.Forms.ToolStripButton btn_UpDelete;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
|
||||
private System.Windows.Forms.ToolStripButton btn_UpLoad;
|
||||
private System.Windows.Forms.Panel leftPanel;
|
||||
private System.Windows.Forms.ToolStrip leftToolStrip;
|
||||
private System.Windows.Forms.ToolStripButton btn_AddTemp;
|
||||
private PdfEditorEx pdfEditorEx;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,409 @@
|
||||
using DevExpress.Utils;
|
||||
using DevExpress.XtraEditors;
|
||||
using DevExpress.XtraEditors.Controls;
|
||||
using DevExpress.XtraEditors.Events;
|
||||
using DevExpress.XtraEditors.Repository;
|
||||
using DevExpress.XtraGrid.Columns;
|
||||
using DevExpress.XtraGrid.Views.Base;
|
||||
using DevExpress.XtraGrid.Views.Grid;
|
||||
using Lskj.Business.Impl;
|
||||
using Lskj.Control;
|
||||
using Lskj.Core;
|
||||
using Lskj.Model;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.PubPdfSign
|
||||
{
|
||||
public partial class FrmUpload : BaseForm
|
||||
{
|
||||
public FrmUpload()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Load += OnFrmMainLoad;
|
||||
this.FormClosed += OnFrmMainClosed;
|
||||
}
|
||||
/// <summary>
|
||||
/// model
|
||||
/// </summary>
|
||||
public DynamicPdfSignModel PdfSignModel;
|
||||
/// <summary>
|
||||
/// AdapterObj
|
||||
/// </summary>
|
||||
public SqlDataAdapter AdapterObj { get; set; }
|
||||
/// <summary>
|
||||
/// 关闭窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnFrmMainClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
this.pdfEditorEx.CloseDocument();
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化控件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnFrmMainLoad(object sender, EventArgs e)
|
||||
{
|
||||
this.btn_UpLoad.Click += OnBtnUpLoadClick;
|
||||
this.btn_UpDelete.Click += OnBtnUpDeleteClick;
|
||||
this.btn_UpSave.Click += OnBtnUpSaveClick;
|
||||
this.btn_AddTemp.Click += OnBtnAddTempClick;
|
||||
this.gridView.RowClick += OnGridViewRowClick;
|
||||
this.gridView.FocusedRowObjectChanged += OnGridViewFocusedRowObjectChanged;
|
||||
this.gridView.CustomDrawCell += OnGridViewCustomDrawCell;
|
||||
this.gridView.CustomDrawRowIndicator += OnGridViewCustomDrawRowIndicator;
|
||||
this.gridView.CellValueChanged += OnGridViewCellValueChanged;
|
||||
InitGridColumns();
|
||||
|
||||
pdfEditorEx.StepTable = MainImpl.GetDataTableResult($"SELECT stepCode, stepName FROM P_systemdlltabflow WHERE typecode = '{PdfSignModel.TypeCode}' UNION ALL SELECT '9999' AS stepCode, '时间' AS stepName;");
|
||||
SetGridViewDataSource(GetAdapterResult($"select * from p_SignAccraditationTable"));
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加模板
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnAddTempClick(object sender, EventArgs e)
|
||||
{
|
||||
using (FrmDesign frmMain = new FrmDesign())
|
||||
{
|
||||
frmMain.ShowDialog();
|
||||
DataTable dataTable = SqlHelper.ExecuteDataTable("select * from P_SignTempTable");
|
||||
versionGridLookUpEdit.DataSource = dataTable;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存按钮点击
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnUpSaveClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DataTable dataTable = this.gcMain.DataSource as DataTable;
|
||||
if (dataTable.Rows.Cast<DataRow>().Where(n => string.IsNullOrWhiteSpace(n["versionCode"] + "")).Count() > 0)
|
||||
{
|
||||
MessageUtil.Show("版本名称不能为空");
|
||||
return;
|
||||
}
|
||||
int result = this.AdapterObj.Update(dataTable);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show($"保存失败,原因:{ex.Message}");
|
||||
return;
|
||||
}
|
||||
MessageUtil.Show("保存成功");
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除按钮点击
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnUpDeleteClick(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
int[] rowids = this.gridView.GetSelectedRows();
|
||||
if (rowids == null || rowids.Length == 0)
|
||||
{
|
||||
MessageUtil.Show("请选择需要删除的数据");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
DialogResult result = MessageUtil.Show($"确定要删除选中{rowids.Length}条数据?", MessageBoxButtons.YesNo);
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
ArrayList localDeletes = new ArrayList();
|
||||
Dictionary<string, string> mList = new Dictionary<string, string>();
|
||||
List<string> delToPosts = new List<string>();
|
||||
foreach (int rowid in rowids)
|
||||
{
|
||||
DataRow rowData = this.gridView.GetDataRow(rowid);
|
||||
if (rowData.RowState != DataRowState.Added)
|
||||
{
|
||||
string fieldValue = rowData["id"] + "";
|
||||
string sqlValue = string.Format("delete from p_SignAccraditationTable where id = '{0}'", fieldValue);
|
||||
mList.Add(fieldValue, sqlValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
localDeletes.Add(rowid);
|
||||
}
|
||||
}
|
||||
if (mList.Count > 0)
|
||||
{
|
||||
string hintMsg = "删除结果如下:\n";
|
||||
foreach (string primaryKey in mList.Keys)
|
||||
{
|
||||
try
|
||||
{
|
||||
string deleteSql = mList[primaryKey];
|
||||
SqlHelper.ExecuteNonQuery(deleteSql);
|
||||
hintMsg += "记录[" + primaryKey + "]删除成功.\n";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
hintMsg += "记录[" + primaryKey + "]删除失败,原因:" + ex.Message + "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (localDeletes.Count > 0)
|
||||
{
|
||||
// 删除选中且未保存的数据
|
||||
for (int i = localDeletes.Count - 1; i >= 0; i--)
|
||||
{
|
||||
this.gridView.DeleteRow((int)localDeletes[i]);
|
||||
}
|
||||
MessageUtil.Show("删除成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageUtil.Show("无法删除");
|
||||
}
|
||||
}
|
||||
SetGridViewDataSource(GetAdapterResult($"select * from p_SignAccraditationTable"), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 上传按钮点击
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnUpLoadClick(object sender, EventArgs e)
|
||||
{
|
||||
using (OpenFileDialog dialog = new OpenFileDialog())
|
||||
{
|
||||
dialog.Multiselect = true;//该值确定是否可以选择多个文件
|
||||
dialog.Title = "请选择文件";
|
||||
dialog.Filter = "PDF文件(*.pdf)|*.pdf";
|
||||
if (dialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
foreach (string fileFullName in dialog.FileNames)
|
||||
{
|
||||
AddGridViewRecord(fileFullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 版本改变时改变签名位置
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnGridViewCellValueChanged(object sender, CellValueChangedEventArgs e)
|
||||
{
|
||||
if (e.Column.FieldName.Equals("versionCode"))
|
||||
{
|
||||
string versionCode = this.gridView.GetFocusedRowCellValue(e.Column) + "";
|
||||
if (!string.IsNullOrWhiteSpace(versionCode))
|
||||
{
|
||||
this.pdfEditorEx.ClearSignBox();
|
||||
this.pdfEditorEx.LoadSign(versionCode, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 点击指定行
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnGridViewRowClick(object sender, RowClickEventArgs e)
|
||||
{
|
||||
DataRow dataRow = this.gridView.GetDataRow(e.RowHandle);
|
||||
if (dataRow != null)
|
||||
{
|
||||
string versionCode = dataRow.Table.Columns.Contains("versionCode") ? dataRow["versionCode"] + "" : "";
|
||||
this.pdfEditorEx.VersionCode = versionCode;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 选中行改变时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnGridViewFocusedRowObjectChanged(object sender, FocusedRowObjectChangedEventArgs e)
|
||||
{
|
||||
DataRow dataRow = this.gridView.GetFocusedDataRow();
|
||||
if (dataRow != null)
|
||||
{
|
||||
string versionCode = dataRow.Table.Columns.Contains("versionCode") ? dataRow["versionCode"] + "" : "";
|
||||
this.pdfEditorEx.VersionCode = versionCode;
|
||||
this.pdfEditorEx.OpenLocalFile(dataRow, false);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 选中行颜色
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnGridViewCustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
|
||||
{
|
||||
if (e.RowHandle == gridView.FocusedRowHandle)
|
||||
{
|
||||
e.Appearance.BackColor = ColorTranslator.FromHtml("#9feb6a");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示表格序号
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnGridViewCustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
e.Appearance.TextOptions.HAlignment = HorzAlignment.Center;
|
||||
if (e.Info.IsRowIndicator)
|
||||
{
|
||||
if (e.RowHandle >= 0)
|
||||
{
|
||||
e.Info.DisplayText = (e.RowHandle + 1).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 弹出框弹出时
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnSearchEditQueryPopUp(object sender, CancelEventArgs e)
|
||||
{
|
||||
int popWidth = 0;
|
||||
GridLookUpEdit edit = (sender as GridLookUpEdit);
|
||||
foreach (GridColumn col in edit.Properties.View.Columns)
|
||||
{
|
||||
int colWidth = col.GetBestWidth();
|
||||
col.Width = colWidth;
|
||||
popWidth += colWidth;
|
||||
}
|
||||
edit.Properties.PopupFormSize = new Size(popWidth, edit.Properties.PopupFormSize.Height);
|
||||
}
|
||||
/// <summary>
|
||||
/// 设置数据源
|
||||
/// </summary>
|
||||
private int SetGridViewDataSource(SqlDataAdapter adapter, bool selectRowHandler = true)
|
||||
{
|
||||
if (adapter == null) return 0;
|
||||
try
|
||||
{
|
||||
this.AdapterObj = adapter;
|
||||
DataSet dataSet = new DataSet();
|
||||
adapter.Fill(dataSet, "SetGridViewDataSource");
|
||||
SqlCommandBuilder cb = new SqlCommandBuilder(this.AdapterObj);
|
||||
DataTable dt = dataSet.Tables[0];
|
||||
this.gcMain.DataSource = dt;
|
||||
this.gridView.BestFitColumns();
|
||||
if (selectRowHandler)
|
||||
this.gridView.SelectRow(this.gridView.FocusedRowHandle);
|
||||
return dataSet.Tables[0] != null ? dataSet.Tables[0].Rows.Count : 0;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/// <summary>
|
||||
/// 直接表格添加数据
|
||||
/// </summary>
|
||||
/// <param name="fullName"></param>
|
||||
private void AddGridViewRecord(string fullName)
|
||||
{
|
||||
try
|
||||
{
|
||||
DataTable dt = this.gcMain.DataSource as DataTable;
|
||||
DataRow dataRow = dt.NewRow();
|
||||
dataRow["localPath"] = fullName;
|
||||
dataRow["pdfUrl"] = fullName;
|
||||
string fileName = Path.GetFileNameWithoutExtension(fullName);
|
||||
dataRow["fileName"] = fileName;
|
||||
dataRow["stepCode"] = "100";
|
||||
dataRow["operator"] = ERPInfo.Instance.UserId;
|
||||
dt.Rows.Add(dataRow);
|
||||
this.gridView.UpdateCurrentRow();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取数据
|
||||
/// </summary>
|
||||
/// <param name="sqlValue"></param>
|
||||
/// <returns></returns>
|
||||
private SqlDataAdapter GetAdapterResult(string sqlValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(sqlValue)) return new SqlDataAdapter();
|
||||
return SqlHelper.ExecuteAdapter(CommandType.Text, sqlValue);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
return new SqlDataAdapter();
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化表格列
|
||||
/// </summary>
|
||||
private void InitGridColumns()
|
||||
{
|
||||
versionGridLookUpEdit.View.OptionsView.ShowIndicator = false;
|
||||
versionGridLookUpEdit.View.OptionsView.ColumnAutoWidth = false;
|
||||
versionGridLookUpEdit.PopupSizeable = true;
|
||||
versionGridLookUpEdit.PopupResizeMode = ResizeMode.Default;
|
||||
versionGridLookUpEdit.AllowFocused = true;
|
||||
versionGridLookUpEdit.ImmediatePopup = true;
|
||||
versionGridLookUpEdit.ShowFooter = false;
|
||||
versionGridLookUpEdit.NullText = "";
|
||||
versionGridLookUpEdit.TextEditStyle = TextEditStyles.Standard;
|
||||
versionGridLookUpEdit.PopupBorderStyle = PopupBorderStyles.Flat;
|
||||
versionGridLookUpEdit.AllowNullInput = DefaultBoolean.False;
|
||||
versionGridLookUpEdit.ShowPopupShadow = true;
|
||||
versionGridLookUpEdit.DisplayMember = "versionName";
|
||||
versionGridLookUpEdit.ValueMember = "id";
|
||||
versionGridLookUpEdit.View.Appearance.HeaderPanel.TextOptions.HAlignment = HorzAlignment.Center;
|
||||
GridColumn valueColumn = new GridColumn();
|
||||
valueColumn.Name = valueColumn.FieldName = "id";
|
||||
valueColumn.Caption = "编码";
|
||||
valueColumn.Visible = true;
|
||||
GridColumn textColumn = new GridColumn();
|
||||
textColumn.Name = textColumn.FieldName = "versionName";
|
||||
textColumn.Caption = "版本名称";
|
||||
textColumn.Visible = true;
|
||||
versionGridLookUpEdit.View.Columns.AddRange(new GridColumn[] { valueColumn, textColumn });
|
||||
versionGridLookUpEdit.QueryPopUp += new CancelEventHandler(OnSearchEditQueryPopUp);
|
||||
gcMain.RepositoryItems.Add(versionGridLookUpEdit);
|
||||
DataTable dataTable = SqlHelper.ExecuteDataTable("select * from P_SignTempTable");
|
||||
versionGridLookUpEdit.DataSource = dataTable;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="rightToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 59</value>
|
||||
</metadata>
|
||||
<metadata name="leftToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>176, 59</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="btn_AddTemp.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="rightToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 59</value>
|
||||
</metadata>
|
||||
<data name="btn_UpSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="btn_UpDelete.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="btn_UpLoad.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,169 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{D507E99B-F270-4CEE-8645-BE83128C10D7}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Lskj.PubPdfSign</RootNamespace>
|
||||
<AssemblyName>Lskj.PubPdfSign</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Debug\Lib\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DevExpress.BonusSkins.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Data.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Utils.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraGrid.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraPrinting.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="itextsharp, Version=5.5.8.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\itextsharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="O2S.Components.PDFView4NET, Version=4.7.4.0, Culture=neutral, PublicKeyToken=bdf0cc7afcc23208, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\O2S.Components.PDFView4NET.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Xilium.CefGlue, Version=87.1.1.0, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\引用DLL\Xilium.CefGlue.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controls\ControlExtensions.cs" />
|
||||
<Compile Include="FileUploadUtil.cs" />
|
||||
<Compile Include="FrmAdd.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FrmAdd.Designer.cs">
|
||||
<DependentUpon>FrmAdd.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FrmAddSign.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FrmAddSign.Designer.cs">
|
||||
<DependentUpon>FrmAddSign.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FrmDesign.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FrmDesign.Designer.cs">
|
||||
<DependentUpon>FrmDesign.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\PdfEditorEx.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\PdfEditorEx.Designer.cs">
|
||||
<DependentUpon>PdfEditorEx.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ResizeControl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ResizeControl.Designer.cs">
|
||||
<DependentUpon>ResizeControl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\SignBox.cs" />
|
||||
<Compile Include="DllBaseClass.cs" />
|
||||
<Compile Include="Model\UploadModel.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="FrmAdd.resx">
|
||||
<DependentUpon>FrmAdd.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="FrmAddSign.resx">
|
||||
<DependentUpon>FrmAddSign.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="FrmDesign.resx">
|
||||
<DependentUpon>FrmDesign.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Controls\PdfEditorEx.resx">
|
||||
<DependentUpon>PdfEditorEx.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\licenses.licx" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="app.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Lskj.Business\Lskj.Business.csproj">
|
||||
<Project>{7EAFCCC2-A18F-49E9-85C6-A984966CFD01}</Project>
|
||||
<Name>Lskj.Business</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Lskj.Control\Lskj.Control.csproj">
|
||||
<Project>{447cdc40-659f-4cca-9ed6-8e818b4cf8bf}</Project>
|
||||
<Name>Lskj.Control</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Lskj.Core\Lskj.Core.csproj">
|
||||
<Project>{2a1be6ac-1077-491b-a754-c5822fe8121e}</Project>
|
||||
<Name>Lskj.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Lskj.Model\Lskj.Model.csproj">
|
||||
<Project>{52BC40E0-C0C6-4F78-996B-CAE028D209CA}</Project>
|
||||
<Name>Lskj.Model</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Lskj.Util\Lskj.Util.csproj">
|
||||
<Project>{A51BF642-6543-4DE3-8948-83F558B72BD4}</Project>
|
||||
<Name>Lskj.Util</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Lskj.PubPdfSign.Model
|
||||
{
|
||||
public class UploadModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否为附件模块
|
||||
/// </summary>
|
||||
public bool isAdditional { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 文件id
|
||||
/// </summary>
|
||||
public string FileId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件名
|
||||
/// </summary>
|
||||
public string FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 节点
|
||||
/// </summary>
|
||||
public string SpeciesNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件版本
|
||||
/// </summary>
|
||||
public string Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件地址
|
||||
/// </summary>
|
||||
public string Webpath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// sql
|
||||
/// </summary>
|
||||
public string ExecSql { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回信息
|
||||
/// </summary>
|
||||
public string Msg { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("Lskj.PubPdfSign")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Lskj.PubPdfSign")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("d507e99b-f270-4cee-8645-be83128c10d7")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,70 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本: 4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace Lskj.PubPdfSign.Properties
|
||||
{
|
||||
/// <summary>
|
||||
/// 强类型资源类,用于查找本地化字符串等。
|
||||
/// </summary>
|
||||
// 此类是由 StronglyTypedResourceBuilder
|
||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回此类使用的缓存 ResourceManager 实例。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Lskj.PubPdfSign.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace Lskj.PubPdfSign.Properties
|
||||
{
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NPOI" publicKeyToken="0df73ec7942b34e1" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.1.3.1" newVersion="2.1.3.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user