AutoPackage/AutoPekage/frmStmpServer.cs

36 lines
1.0 KiB
C#
Raw Permalink Normal View History

2017-02-05 15:30:23 +08:00
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;
}
}
}