/// <summary> /// 查看列表 /// </summary> /// <returns></returns> public Student ShowStudentInfo(string stuNo) { try { string sqlWhere = string.Format(" and stuNo='{0}' ", stuNo); List <Student> list = StudentAccess.Select(sqlWhere); if (list != null && list.Count == 1) { return(list[0]); } return(null); } catch (Exception ex) { return(null); } }
/// <summary> /// 学生登录:输入账号密码,如果登录成功返回当前账号对象,否则返回NULL /// </summary> /// <param name="account"></param> /// <param name="password"></param> /// <returns></returns> public Student Login(string account, string password) { if (string.IsNullOrEmpty(account)) { return(null); } try { string sqlWhere = string.Format(" and stuNo ='{0}' and stuPwd='{1}'", account, password); List <Student> list = StudentAccess.Select(sqlWhere); if (list != null && list.Count == 1) { return(list[0]); } return(null); } catch (Exception ex) { return(null); } }