📄 search.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
namespace renshiguanli
{
public partial class Search : Form
{
public static string name_search;
public static string email_search;
public static int deptid_search;
public Search()
{
InitializeComponent();
Information.sql.set_combobox(comboBox_department);
comboBox_department .SelectedIndex = -1;
name_search = "";
email_search = "";
deptid_search = -1;
}
private void btn_cancle_Click(object sender, EventArgs e)
{
this.Close();
}
private void btn_0k_Click(object sender, EventArgs e)
{
// textBox_mail.Text = comboBox_department.SelectedValue.ToString();
Regex mail = new Regex(@"^\w{1,20}@\w{1,20}.\w{1,20}");
if (!mail.IsMatch(textBox_mail.Text) && textBox_mail.Text != "")
{
MessageBox.Show("Email格式错误");
}
else
{
name_search = textBox_name.Text;
email_search = textBox_mail.Text;
try
{
deptid_search = (int)comboBox_department.SelectedValue;
}
catch
{
deptid_search = -1;
}
if (name_search == "" && email_search == "" && deptid_search == -1)
{
MessageBox.Show("查询条件不能全部为空!");
}
else
{
this.DialogResult = DialogResult.OK;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -