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; } /// /// 初始化控件 /// /// /// private void OnFrmAddLoad(object sender, EventArgs e) { this.btn_Ok.Click += OnBtnOkClick; this.btn_Cancel.Click += OnBtnCancelClick; } /// /// 取消 /// /// /// private void OnBtnCancelClick(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; this.Close(); } /// /// 确定 /// /// /// 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(); } /// /// 文件名 /// public string FileName { get { return this.txt_FileName.Text; } set { this.txt_FileName.Text = value; } } /// /// 文件版本 /// public string VersionName { get { return this.txt_VersionName.Text; } set { this.txt_VersionName.Text = value; } } } }