//修改用户密码(原密码) public bool ChangePasswordByOldPassword(string number, string oldpassword, string newpassword) { SLogin slogin = new SLoginService().LoginBySNumber(number); if (slogin.SPassword == oldpassword) { return(new SLoginService().ChangePassword(number, newpassword)); } else { return(false); } }
//学生登录 public bool SLogin(string LoginId, string LoginPwd, out SLogin S) { SLogin s = new SLoginService().LoginBySNumber(LoginId); if (s == null) { S = null;//用户名不存在 return(false); } if (s.SPassword == LoginPwd) { S = s;//登录成功 return(true); } else { S = null;//登录失败 return(false); } }