private void button1_Click(object sender, EventArgs e) { int i = Convert.ToInt16(LYFunctionCsClass.cmdScalar("select count(*) from ysfs where type='职员' and UPPER(ysid)='" + textBox1.Text.ToUpper() + "'", LoginClass.ConnectString)); if (i == 0) { MessageBox.Show("用户不存在,请重新输入", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); textBox1.Focus(); textBox1.SelectAll(); return; } int j = Convert.ToInt16(LYFunctionCsClass.cmdScalar("select count(*) from ysfs where type='职员' and UPPER(ysid)='" + textBox1.Text.ToUpper() + "' and UPPER(nvl(RESERVE1,'!@#$%^&*()'))='" + (textBox2.Text == "" ? "!@#$%^&*()" : textBox2.Text).ToString() + "'", LoginClass.ConnectString)); if (j == 0) { MessageBox.Show("密码不正确,请重新输入", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); textBox2.Focus(); textBox2.SelectAll(); return; } LoginClass.LogID = textBox1.Text; ifNotCanClose = false; this.Close(); }
private void button3_Click(object sender, EventArgs e) { int i = Convert.ToInt16(LYFunctionCsClass.cmdScalar("select count(*) from ysfs where type='职员' and UPPER(ysid)='" + textBox1.Text.ToUpper() + "'", LoginClass.ConnectString)); if (i == 0) { MessageBox.Show("用户不存在,请重新输入", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); textBox1.Focus(); textBox1.SelectAll(); return; } int j = Convert.ToInt16(LYFunctionCsClass.cmdScalar("select count(*) from ysfs where type='职员' and UPPER(ysid)='" + textBox1.Text.ToUpper() + "' and UPPER(nvl(RESERVE1,'!@#$%^&*()'))='" + (textBox2.Text == "" ? "!@#$%^&*()" : textBox2.Text).ToString() + "'", LoginClass.ConnectString)); if (j == 0) { MessageBox.Show("密码不正确,请重新输入", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); textBox2.Focus(); textBox2.SelectAll(); return; } if (textBox4.Text.ToUpper() != textBox5.Text.ToUpper()) { MessageBox.Show("\"新密码\"与\"确认新密码\"不相符", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } LYFunctionCsClass.cmd("update ysfs set RESERVE1='" + textBox5.Text + "' where type='职员' and upper(ysid)='" + textBox1.Text.ToUpper() + "'", LoginClass.ConnectString); label5.Visible = false; label6.Visible = false; textBox4.Visible = false; textBox5.Visible = false; MessageBox.Show("密码修改在成功,请用新密码登录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); }