1.項(xiàng)目操作流程
先打登陸界面輸入用戶名和密碼登陸
1.PNG
登陸成功之后顯示操作頁(yè)面
2.PNG
3.PNG
2.描述項(xiàng)目操作流程動(dòng)圖功能和步驟铝穷;
第一步:調(diào)試該程序然后彈出登錄界面;
第二步:輸入職員忙干、管理員賬號(hào)和密碼點(diǎn)擊登錄辕翰;
第三步:登錄成功進(jìn)入主界面;
3.相關(guān)代碼
private void bt_Login_Click(object sender, EventArgs e)
{
if (this.cbb_Type.SelectedItem.ToString() == "職員")
{
if (this.tb_User.Text == "154" && this.tb_Password.Text == "123")
{
MessageBox.Show("職員登錄成功");
// 顯示收銀員主界面
MainFormUser formUser = new MainFormUser();
formUser.userName = this.tb_User.Text.ToString();
formUser.Show();
// 隱藏登錄界面
this.Hide();
}
else
{
MessageBox.Show("用戶名或密碼錯(cuò)誤", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
if (this.cbb_Type.SelectedItem.ToString() == "管理員")
{
if (this.tb_User.Text == "1" && this.tb_Password.Text == "123")
{
MessageBox.Show("管理員登錄成功");
// 顯示庫(kù)管員主界面
MainFormAdmin formAdmin = new MainFormAdmin();
formAdmin.userName = this.tb_User.Text.ToString();
formAdmin.Show();
// 隱藏登錄界面
this.Hide();
}
else
{
MessageBox.Show("用戶名或密碼錯(cuò)誤", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
// 點(diǎn)擊“退出”按鈕則退出應(yīng)用程序
private void bt_Exit_Click(object sender, EventArgs e)
{
Application.Exit();
}