You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.2 KiB
C#

2 years ago
using Rs.Framework;
using Rs.MotionPlat.Commom;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Rs.MotionPlat
{
public partial class UserForm : BaseFormHeader
{
public UserForm()
{
InitializeComponent();
}
private void btnCancle_Click(object sender, EventArgs e)
{
this.Close();
}
private void UserForm_Load(object sender, EventArgs e)
{
cboxUsers.SelectedIndex = 0;
}
private void btnLogin_Click(object sender, EventArgs e)
{
string username = cboxUsers.SelectedItem.ToString();
string userpwd = txtPassword.Text.Trim();
if(username=="操作员")
{
if(userpwd == "123")
{
GlobalUser.UserLevel = EUserLevel.Op;
GlobalUser.UserName = username;
this.Close();
}
else
{
Msg.ShowError("userpwd error,please input again");
txtPassword.Text = "";
}
}
else if (username == "超级用户")
{
if (userpwd == "lhiven@123")
{
GlobalUser.UserLevel = EUserLevel.Admin;
GlobalUser.UserName = username;
this.Close();
}
else
{
Msg.ShowError("userpwd error,please input again");
txtPassword.Text = "";
}
}
else if (username == "厂商")
{
if (userpwd == "rs@rs")
{
GlobalUser.UserLevel = EUserLevel.Vender;
GlobalUser.UserName = username;
this.Close();
}
else
{
Msg.ShowError("userpwd error,please input again");
txtPassword.Text = "";
}
}
}
}
}