protected void loginButton_Click(object sender, EventArgs e) { UserTypeDao userTypeDao = new UserTypeDao(); userTypeDao.userName = userNameTextBox.Text; userTypeDao.password = passwordTextBox.Text; userTypeDao.userType = userTypeDDList.SelectedItem.Text; if(userTypeDDList.SelectedItem.Text!= "---User Type---") { UserLoginDal userLoginDal = new UserLoginDal(); DataTable dt = userLoginDal.GetLoginInDB(userTypeDao); if(dt.Rows.Count>0) { Session["user"] = userNameTextBox.Text; if(dt.Rows[0]["User_Type"].ToString() == "Assistance") Response.Redirect("PatientInfoInsertPage.aspx"); if (dt.Rows[0]["User_Type"].ToString() == "Doctor") Response.Redirect("DoctorPageUI.aspx"); } else { Response.Write("User name or Passowrd does not match!"); } } else { Response.Write("Select the user type..."); } }
/// <summary> /// 找回密码 /// </summary> /// <param name="Acc"></param> /// <returns></returns> public static string GetUser(string Acc) { UserLogin us = new UserLogin(); if (UserLoginDal.GetLogin().Where(c => c.UserAccount == Acc).ToList().Count == 0) { return("用户名不存在"); } return("信息已发送至邮箱,请注意查收"); }
/// <summary> /// 查询是否存在相同的邮箱 /// </summary> /// <param name="username"></param> /// <param name="Acc"></param> /// <param name="us"></param> /// <returns></returns> public static string SelectUser(string Acc, UserLogin us) { string str = " where UserAccount='" + Acc + "'"; List <UserLogin> login = UserLoginDal.GetLogin(str); if (login.Count != 0) { str = "已存在相同的邮箱"; return(str); } return(InsertUserLogin(us)); }
/// <summary> /// 注册 /// </summary> /// <param name="us"></param> /// <returns></returns> public static string InsertUserLogin(UserLogin us) { us.USerPassword = Encryption(us.USerPassword); string str = ""; switch (UserLoginDal.InsertUserLogin(us)) { case 1: str = "注册成功"; break; default: str = "注册失败"; break; } return(str); }
public UserInfo UserLogin(UserInfo user) { user = UserLoginDal.Login(user); if (!user.LoginFlag) { return(user); } if (user.RememberMe == true) { user.RememberPassWord = Encrypt.MD5ToString(user.UserName, user.PassWord); } else { user.RememberPassWord = ""; } SaveRememberUser(user); return(user); }
/// <summary> /// 登录 /// </summary> /// <param name="Acc"></param> /// <param name="pwd"></param> /// <returns></returns> public static int GetUser(string Acc, string pwd) { int str = -1; pwd = Encryption(pwd); if (UserLoginDal.GetLogin().Where(c => c.UserAccount == Acc).ToList().Count == 0) { str = 0;//用户名不存在 return(str); } List <UserLogin> mer = UserLoginDal.GetLogin(" where UserAccount='" + Acc + "' and USerPassword='******'"); if (mer.Count == 0) { str = 1;//密码错误 return(str); } return(str);//登录成功 }
/// <summary> /// 表单信息添加 /// </summary> /// <param name="model">表单信息</param> /// <returns></returns> public override bool AddForm(UserModel model) { UserLoginDal loginDal = new UserLoginDal(); bool res = base.AddForm(model); if (res) { UserLoginModel loginModel = new UserLoginModel(); loginModel.F_Id = Utility.GuId(); loginModel.F_UserId = model.F_Id; loginModel.F_LogOnCount = 0; loginModel.F_MultiUserLogin = 0; loginModel.F_LoginStatus = 0; loginModel.F_EnableLogin = 1; loginModel.F_Secretkey = LtCore.Core.GetSecretkey(); loginModel.F_Password = LtCore.Core.GetDbPassword(loginModel.F_Secretkey); loginModel.F_ChangePassTime = null; loginModel.F_LastVisitTime = null; res = loginDal.AddForm(loginModel); } return(res); }
public static bool Login(UserDto user, ModelUnibookContainer objContext) { return(UserLoginDal.Login(user, objContext)); }
public static bool ChangePassword(PasswordDto user, ModelUnibookContainer objContext) { return(UserLoginDal.ChangePassword(user, objContext)); }
public static List <Details> GetDerails(UserLogin us) { us.USerPassword = Encryption(us.USerPassword); return(UserLoginDal.GetDetails(us)); }