📄 deptselect.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.Data.SqlClient;
using System.IO;
namespace BlueHill_Win_
{
public partial class DeptSelect : Form
{
public DeptSelect()
{
InitializeComponent();
}
private void btnCancel_Click(object sender, EventArgs e)
{
//this.Hide();
//WorkingOvertimeManagement WOM = new WorkingOvertimeManagement();
//WOM.Show();
this.Close();
}
private void btnOK_Click(object sender, EventArgs e)
{
if (textBox1.Text.Trim() !="")
{
SqlConnection con = DB.connection();
con.Open();
SqlCommand cmd = new SqlCommand("select count(*) from 部门表 where 部门名称='"+ textBox1.Text.ToString().Trim() +"'",con);
int count = Convert.ToInt32(cmd.ExecuteScalar());
if (count == 0)
{
con.Close();
DialogResult = MessageBox.Show("该部门不存在!", "提示");
}
else
{
DB.setA = textBox1.Text.Trim();
this.Close();
////WorkingOvertimeManagement WOM = new WorkingOvertimeManagement();
////WOM.Show();
}
}
else
DialogResult = MessageBox.Show("请输入你要查询的部门名称!", "提示");
}
private void DeptSelect_Load(object sender, EventArgs e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -