本文整理汇总了C#中User.CheckUser方法的典型用法代码示例。如果您正苦于以下问题:C# User.CheckUser方法的具体用法?C# User.CheckUser怎么用?C# User.CheckUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User
的用法示例。
在下文中一共展示了User.CheckUser方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: button1_Click
private void button1_Click(object sender, EventArgs e)
{
string empId = textBox1.Text;
string password = textBox2.Text;
User aOldUser = new User(empId, password);
User findUser = aOldUser.GetUserInformation(empId);
bool login = aOldUser.CheckUser(aOldUser);
if (login)
{
string newPw1 = textBox3.Text;
string newPw2 = textBox4.Text;
if (newPw1==newPw2)
{
User aNewUser = new User(empId,newPw1,findUser.UserType);
aNewUser.UpdateInformation(aOldUser,aNewUser);
MessageBox.Show("Password updated");
this.Close();
fmLogin.f.Show();
}
else
{
MessageBox.Show("The two passwords do not match.");
}
}
}
示例2: btnLogin_Click
private void btnLogin_Click(object sender, EventArgs e)
{
string empId = txtUserName.Text;
string password = txtUserPwd.Text;
User aUser = new User(empId, password);
bool login = aUser.CheckUser(aUser);
if (login)
{
typeNumber = aUser.GetType(aUser);
FormMain aForm = new GUI.Main.FormMain(typeNumber);
aForm.Show();
this.Hide();
}
}
示例3: RegisterUser
public void RegisterUser()
{
if (CheckPage())
{
User UserObj = new User();
UserObj.Email = txtEmail.Text;
UserObj.Password = txtPwd.Text;
UserObj.Image = USER_INIT_PATH;
if (!UserObj.CheckUser())
{
if (UserObj.RegUser())
{
//userInfo uInfo = new userInfo();
//uInfo.UserId = UserObj.UserId;
//uInfo.UserName = getUserName(UserObj.Email);
//Session.Add("_di09USR", uInfo);
//Response.Redirect("~/home.aspx", true);
LoginCls LogObj = new LoginCls(UserObj.Email, UserObj.GetPassword);
switch (LogObj.CheckLogin("user"))
{
case users.Anonymous:
ShowMessage(Message.Error, "Invalid Username Or Password.");
break;
case users.User:
Session.Add("_di09USR", LogObj.UInfo);
Response.Redirect(LogObj.ProfilePage, true);
break;
default:
break;
}
}
else
{
ShowMessage(Message.Error, "Unable To Register.");
}
}
else
{
ShowMessage(Message.Warning, "Email Already Exists.");
}
}
else
{
ShowMessage(Message.Error, "Fill all fields.");
}
}
示例4: Login
public int Login(string email_id, string password)
{
User u = new User();
bool result= u.CheckUser(email_id, password);
if (result)
{
string status= u.CheckStatus(email_id);
if (status == "Admin")
return 10;
else
return 1;
}
else
return 0;
}
示例5: UserRegister
public int UserRegister(string emailid, string pasword, string fname, string lname, string cotry, DateTime date, string status,string image)
{
User a = new User(emailid, pasword, fname, lname, cotry, date, status,image);
bool result=a.CheckUser(emailid);
if (result == true)
{
int i= a.AddUser(pasword, emailid, fname, lname, cotry, date, status, image);
if (i > 0)
return 1;
else
return 0;
}
else
{
return -1;
}
}