private void button3_Click(object sender, EventArgs e) { int i = 0; FrmSelect f = new FrmSelect(i, toolStripMain.Text, limit); f.Show(); }
private void patentSearchPB_Click(object sender, EventArgs e) { int i = 0; FrmSelect f = new FrmSelect(i, toolStripStatusLabel.Text, limit); f.WindowState = FormWindowState.Maximized; //去掉边框 f.FormBorderStyle = FormBorderStyle.None; f.MdiParent = this; //设置新窗体的Parent f.Parent = panel2; f.Show(); }
//尝试一下是否拉去成功 /* private void button1_Click(object sender, EventArgs e) * { * FrmAdd f = new FrmAdd(); * f.Show(); * * } * * private void button2_Click(object sender, EventArgs e) * { * int i = 0; * FrmSelect f = new FrmSelect(i, toolStripMain.Text); * f.Show(); * } * * private void button3_Click(object sender, EventArgs e) * { * int i = 0; * FrmSelect f = new FrmSelect(i, toolStripMain.Text,limit); * f.Show(); * }*/ private void 数据查询ToolStripMenuItem1_Click(object sender, EventArgs e) { frm[fmusermanggerindex] = null; frm[fmaddindex] = null; if (frm[fmselectindex] != null) { frm[fmselectindex].Activate(); return; } fmselect = new FrmSelect(0, limit); frm[fmselectindex] = fmselect; fmselect.WindowState = FormWindowState.Maximized; //去掉边框 fmselect.FormBorderStyle = FormBorderStyle.None; fmselect.MdiParent = this; //设置新窗体的Parent fmselect.Parent = mdiPanel; fmselect.Show(); }
private void btnLogin_Click(object sender, EventArgs e) { string userNum = txtNum.Text; string userPassword = txtPassword.Text; txtPassword.Text = "123456"; int limit = 1; bool resultnum = false; bool resultlimit = false; bool resultlogin = false; prompt1.Text = ""; prompt2.Text = ""; if (txtNum.Text == "") { prompt1.Text = "账号不能为空"; prompt1.ForeColor = Color.Red; return; } if (txtPassword.Text == "") { prompt2.Text = "密码不能为空"; prompt2.ForeColor = Color.Red; return; } string checkname = "select count(*) from users where users_num = '" + userNum + "'"; resultnum = Program.SearchSql(checkname); if (!resultnum) { prompt1.Text = "手机号不存在"; prompt1.ForeColor = Color.Red; return; } if (btnManager.Checked == true) { limit = 2; string checklimit = "select count(*) from users where users_num = '" + userNum + "' and users_limit = 2"; resultlimit = Program.SearchSql(checklimit); if (!resultlimit) { prompt3.Text = "该账号不是管理员账号"; prompt3.ForeColor = Color.Red; return; } resultlogin = login(userNum, userPassword, limit); if (resultlogin) { Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); cfa.AppSettings.Settings["usernum"].Value = userNum; cfa.Save(); ConfigurationManager.RefreshSection("appSettings"); FrmMain f = new FrmMain(userNum, limit); f.Show(); this.Hide(); } else { prompt2.Text = "密码错误"; prompt2.ForeColor = Color.Red; return; } } if (btnUser.Checked == true) { limit = 1; string checklimit = "select count(*) from users where users_num = '" + userNum + "' and users_limit = 1"; resultlimit = Program.SearchSql(checklimit); if (!resultlimit) { prompt3.Text = "该账号不是用户账号"; prompt3.ForeColor = Color.Red; return; } resultlogin = login(userNum, userPassword, limit); if (resultlogin) { Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); cfa.AppSettings.Settings["usernum"].Value = userNum; cfa.Save(); ConfigurationManager.RefreshSection("appSettings"); FrmSelect f = new FrmSelect(userNum, limit); f.Show(); this.Hide(); } else { prompt2.Text = "密码错误"; prompt2.ForeColor = Color.Red; return; } } }