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 AutoPekage { public partial class frmStmpServer : Form { public frmStmpServer() { InitializeComponent(); } private void btnOK_Click(object sender, EventArgs e) { if (LiteDbHelper.GetAllStmpServer().Where(x => x.Stmp == txtStmpAddr.Text || x.ServerName == txtServerName.Text).Count() > 0) { MessageBox.Show("stmp地址或发信服务器名字已经存在,请检查!", "自动打包", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } LiteDbHelper.AddStmpServer(txtServerName.Text, txtStmpAddr.Text); this.DialogResult = DialogResult.OK; } private void btnCencel_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; } } }