/// <summary> /// 根据学号获取读者信息 /// </summary> /// <param name="cardNum"></param> /// <returns></returns> public string GetBaseReaderInfo(string cardNum) { try { SeatManage.ClassModel.ReaderInfo reader = seatDataService.GetReader(cardNum, false); if (reader != null) { JM_ReaderInfo jm_Reader = new JM_ReaderInfo(); jm_Reader.CardId = reader.CardID; jm_Reader.CardNo = reader.CardNo; jm_Reader.Name = reader.Name; jm_Reader.Sex = reader.Sex; return(SeatManage.SeatManageComm.JSONSerializer.Serialize(jm_Reader)); } else { JM_HandleResult result = new JM_HandleResult(); result.Result = false; result.Msg = "对不起,此读者信息不存在"; return(SeatManage.SeatManageComm.JSONSerializer.Serialize(result)); } } catch (Exception ex) { SeatManage.SeatManageComm.WriteLog.Write("根据学号获取读者信息遇到异常:" + ex.Message); JM_HandleResult result = new JM_HandleResult(); result.Result = false; result.Msg = "执行遇到异常!"; return(SeatManage.SeatManageComm.JSONSerializer.Serialize(result)); } }
/// <summary> /// 获取帐号、需要在客户端验证密码。验证成功返回用户基础信息,否则返回空 /// </summary> /// <param name="cardNum"></param> /// <param name="beforeDays"></param> /// <returns></returns> public string GetReaderAccount(string cardNum, string password) { try { if (string.IsNullOrEmpty(cardNum.Trim()) || string.IsNullOrEmpty(password.Trim())) { JM_HandleResult result = new JM_HandleResult(); result.Result = false; result.Msg = "用户名或密码不能为空!"; return(SeatManage.SeatManageComm.JSONSerializer.Serialize(result)); } JM_ReaderInfo reader = null; SeatManage.ClassModel.UserInfo user = seatDataService.GetUserInfo(cardNum); if (user != null) { string strPwd = SeatManageComm.MD5Algorithm.GetMD5Str32(password); if (strPwd.Equals(user.Password)) { reader = new JM_ReaderInfo(); reader.CardNo = user.LoginId; reader.Name = user.UserName; return(SeatManageComm.JSONSerializer.Serialize(reader)); } else { JM_HandleResult result = new JM_HandleResult(); result.Result = false; result.Msg = "用户名或密码错误!"; return(SeatManage.SeatManageComm.JSONSerializer.Serialize(result)); } } else { JM_HandleResult result = new JM_HandleResult(); result.Result = false; result.Msg = "用户名或密码错误!"; return(SeatManage.SeatManageComm.JSONSerializer.Serialize(result)); } } catch (Exception ex) { SeatManage.SeatManageComm.WriteLog.Write("选择座位遇到异常:" + ex.Message); JM_HandleResult result = new JM_HandleResult(); result.Result = false; result.Msg = "执行遇到异常!"; return(SeatManage.SeatManageComm.JSONSerializer.Serialize(result)); } }