關于智慧商超管理系統(tǒng)的登陸界面詳述文檔
一、登陸界面的效果圖
二、登陸界面實現(xiàn)的功能描述
對用戶類型(收銀員與庫管員)、用戶賬號、和密碼進行驗證,驗證通過之后登錄系統(tǒng)進入智慧商超管理系統(tǒng)。需要輸入的內容有用戶類型、用戶賬號、密碼。
三、登陸界面各控件的參數(shù)設置
Login
| 屬性 |
屬性值 |
| text |
用戶登陸 |
| stratposition |
centerscreen |
| maximizebox |
False |
| minimizebox |
False |
| keypreview |
true |
Lable1
Lable2
btnLogin
btnExit
txtID
| 屬性 |
屬性值 |
| text |
用戶密碼 |
| maxlength |
9 |
txtPwd
cmbType
pictureBox
四、重要方法描述
private void Form1_Load(object sender, EventArgs e)//用戶類型自動默認
{
this.comboBox1.SelectedIndex = 0;
}
private void button1_Click(object sender, EventArgs e)//用戶密碼以及登陸正確錯誤提示
{
if (this.textBox1.Text == "wls" && this.textBox2.Text == "666" && this.comboBox1.SelectedItem == "收銀員")
{
MessageBox.Show("正確", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Asterisk);
}
else
if (this.textBox1.Text == "liang" && this.textBox2.Text == "593" && this.comboBox1.SelectedItem == "庫管員")
{
MessageBox.Show("正確", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Asterisk);
}
else
{
MessageBox.Show("錯誤", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Error);
}
}
private void button2_Click(object sender, EventArgs e)//退出按鈕
{
Application.Exit();
}
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)//用戶名輸入后,回車跳轉到密碼輸入框
{
if (System.Convert.ToInt32(e.KeyChar) == 13)
{
System.Windows.Forms.SendKeys.Send("{tab}");
}
}
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)//回車執(zhí)行登陸
{
if (System.Convert.ToInt32(e.KeyChar) == 13)
{
this.button1.Focus();
button1_Click(this, new EventArgs());
}
}
private void textBox1_Enter(object sender, EventArgs e)
{
}
private void textBox2_Enter(object sender, EventArgs e)//tab進入輸入框全選文本
{
((TextBox)sender).SelectAll();
}
}
}
五、尚需完善的功能
登陸界面允許放大后,界面自適應:
1.把自適應的類整體復制到你的工程命名空間里,然后在需要自適應的窗體中做3步即可。
2.聲明自適應類實例。
3.為窗體添加Load事件,并在其方法Form1_Load中,調用類的初始化方法,記錄窗體和其控件初始位置和大小。
4.為窗體添加SizeChanged事件,并在其方法Form1_SizeChanged中,調用類的自適應方法,完成自適應。
連接數(shù)據(jù)庫完成登錄:在數(shù)據(jù)庫中的表member中添加一個屬性字段isroot判斷是否是收銀員員登陸,并在主頁中設置一個登陸界面,當是以收銀員登陸時,跳到對應的managereg.jsp頁面,否則跳到庫管員的頁面。