?? formlogin.cs
字號:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace HRMan
{
public partial class FormLogin : Form
{
public FormLogin()
{
InitializeComponent();
fl = this;
}
private void FormLogin_Load(object sender, EventArgs e)
{
string SqlText = "select * from UserInfo";
DataAccess DA = new DataAccess();
DataTable dt = new DataTable();
dt = DA.ExeSQLdt(SqlText);
for (int i = 0; i < dt.Rows.Count; i++)
{
this.comboBox1.Items.Add(dt.Rows[i]["uName"].ToString());
}
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
string SqlText = "select * from UserInfo where uName='" + this.comboBox1.Text + "' and uPassword='" + this.textBox1.Text + "'";
DataAccess DA = new DataAccess();
if (DA.IsRead(SqlText) == true)
{
string ss = "select * from UserInfo where uName='" + this.comboBox1.Text + "'";
DataTable dt = DA.ExeSQLdt(ss);
this.Competence = dt.Rows[0]["uPower"].ToString();
FormLogin.Can = true;
this.Close();
}
else
{
MessageBox.Show("用戶和密碼不一致!");
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -