日期:2014-05-17 浏览次数:21518 次
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
string sqlcount = "select count(*) from mb_xs_detail where sheet_no='" + this.Name + "' and item_no='" + this.textBox1.Text + "'";
SQLCEWrapper cetest = new SQLCEWrapper();
int i = int.Parse(cetest.ReObjectvalue(sqlcount).ToString());
if (textBox1.Text == "")
{
MessageBox.Show("请输入条码");
this.textBox1.Focus();
}
else if (i != 0)
{
MessageBox.Show("该条码已存在");
this.textBox1.Text = "";
this.textBox1.Focus();
}
else
{