DataSet ds = null;
gkinfo.Gk_num = textBox1.Text.Trim();
ds = baseinfo.DengLu(gkinfo, "db_menu");
gkinfo.Gk_zt = 1;
gkinfo.Gk_apw = gkinfo.Gk_pw;
gkinfo.Gk_name = ds.Tables[0].Rows[0][1].ToString().Trim();
baseinfo.Updatgk(this.gkinfo);
}
private void button1_Click(object sender, EventArgs e)
{
if (radioButton1.Checked) dlsf = 1;
if (radioButton2.Checked) dlsf = 2;
if (textBox1.Text.Trim() == "")
{
label3.Text = "账号不能为空";
textBox1.Focus();
return;
}
else
if (textBox2.Text.Trim() == "")
{
label3.Text = "密码不能为空";
textBox1.Focus();
return;
}
else
if (dlsf == 2)
{
try
{
DataSet ds = null;
gkinfo.Gk_num = textBox1.Text.Trim();
gkinfo.Gk_pw = textBox2.Text.Trim();
ds = baseinfo.DengLu(gkinfo, "db_menu");
if (ds== null||ds.Tables.Count == 0||(ds.Tables.Count == 1 && ds.Tables[0].Rows.Count == 0))
{
MessageBox.Show("用户名错误!");
return;
}
else
if (ds.Tables[0].Rows[0][2].ToString().Trim() != textBox2.Text.Trim())
{ MessageBox.Show("密码错误"); }
else
{
MessageBox.Show("登陆成功!");
dengluzt();
gkfm fm = new gkfm();
fm.add (Convert.ToString(textBox1.Text));
fm.Show();
//this.Hide();
}
}
catch (Exception ee)
{
MessageBox.Show(ee.Message);
}
}
else
if (dlsf == 1)
{
if (textBox1.Text.Trim() == "1" && textBox2.Text.Trim() == "1")
{
MessageBox.Show("登录成功");
sjfm fm = new sjfm();
fm.Show();
// this.Hide();
}
评论1
最新资源