/// <summary> /// 获取可预约的阅览室 /// </summary> /// <param name="date"></param> /// <returns></returns> public string GetCanBespeakRoomInfo(string date) { try { AJM_HandleResult result = new AJM_HandleResult(); List <ReadingRoomInfo> readingRoomModels = SeatManageDateService.GetReadingRoomInfo(null); DateTime bespeakDate = new DateTime(); if (!DateTime.TryParse(date, out bespeakDate)) { result.Result = false; result.Msg = "日期格式错误!"; return(JSONSerializer.Serialize(result)); } List <AJM_ReadingRoom> rooms = new List <AJM_ReadingRoom>(); foreach (ReadingRoomInfo roomInfo in readingRoomModels) { if (!roomInfo.Setting.SeatBespeak.Used)//判断阅览室是否启用预约 { continue; } if (bespeakDate.Date == DateTime.Now.Date && !roomInfo.Setting.SeatBespeak.NowDayBespeak)//预约当天座位 { continue; } if (bespeakDate.Date != DateTime.Now.Date && !roomInfo.Setting.IsCanBespeakSeat(bespeakDate)) { continue; } //启用预约,初始化json要传送的room信息 AJM_ReadingRoom room = new AJM_ReadingRoom(); room.LibraryName = roomInfo.Libaray.Name; room.RoomName = roomInfo.Name; room.RoomNo = roomInfo.No; rooms.Add(room); } result.Result = true; result.Msg = JSONSerializer.Serialize(rooms); return(JSONSerializer.Serialize(result)); } catch (Exception ex) { WriteLog.Write("获取可预约的阅览室遇到异常:" + ex.Message); AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "执行遇到异常!"; return(JSONSerializer.Serialize(result)); } }
public string SubmitBesapeskSeat(string seatNo, string roomNo, string studentNo, string besapeakTime, bool isNowBesapeak) { if (headerCheck.CheckSoapHeader(myHeader, true)) { IMobileAppDataObtianProxy obtainProxy = new MobileAppDataWCFProxy(myHeader.SchoolNum); string r = obtainProxy.SubmitBesapeskSeat(seatNo, roomNo, studentNo, besapeakTime, isNowBesapeak); obtainProxy.Dispose(); return(r); } AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "权限验证失败!"; return(JSONSerializer.Serialize(result)); }
public string QRcodeSeatInfo(string codeStr) { if (headerCheck.CheckSoapHeader(myHeader, true)) { IMobileAppDataObtianProxy obtainProxy = new MobileAppDataWCFProxy(myHeader.SchoolNum); string r = obtainProxy.QRcodeSeatInfo(codeStr); obtainProxy.Dispose(); return(r); } AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "权限验证失败!"; return(JSONSerializer.Serialize(result)); }
public string GetUserNowState(string studentNo, bool isCheckCode) { if (headerCheck.CheckSoapHeader(myHeader, true)) { IMobileAppDataObtianProxy obtainProxy = new MobileAppDataWCFProxy(myHeader.SchoolNum); string r = obtainProxy.GetUserNowStateV2(studentNo, isCheckCode); obtainProxy.Dispose(); return(r); } AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "权限验证失败!"; return(JSONSerializer.Serialize(result)); }
public string CancelBesapeakByCardNo(string cardNo, string bespeakDate) { if (headerCheck.CheckSoapHeader(myHeader, true)) { IMobileAppDataObtianProxy obtainProxy = new MobileAppDataWCFProxy(myHeader.SchoolNum); string r = obtainProxy.CancelBesapeakByCardNo(cardNo, bespeakDate); obtainProxy.Dispose(); return(r); } AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "权限验证失败!"; return(JSONSerializer.Serialize(result)); }
public string SelectSeatByMessager(string studentNo, string seatNo, string roomNo) { if (headerCheck.CheckSoapHeader(myHeader, true)) { IMobileAppDataObtianProxy obtainProxy = new MobileAppDataWCFProxy(myHeader.SchoolNum); string r = obtainProxy.SelectSeatByMessager(studentNo, seatNo, roomNo); obtainProxy.Dispose(); return(r); } AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "权限验证失败!"; return(JSONSerializer.Serialize(result)); }
public string CheckUser(string loginId, string password) { if (headerCheck.CheckSoapHeader(myHeader, true)) { IMobileAppDataObtianProxy obtainProxy = new MobileAppDataWCFProxy(myHeader.SchoolNum); string r = obtainProxy.CheckUser(loginId, password); obtainProxy.Dispose(); return(r); } AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "权限验证失败!"; return(JSONSerializer.Serialize(result)); }
public string GetBespeakDate(string roomNo) { if (headerCheck.CheckSoapHeader(myHeader, true)) { IMobileAppDataObtianProxy obtainProxy = new MobileAppDataWCFProxy(myHeader.SchoolNum); string r = obtainProxy.GetBespeakDate(roomNo); obtainProxy.Dispose(); return(r); } AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "权限验证失败!"; return(JSONSerializer.Serialize(result)); }
public string GetViolationLog(string studentNo, int pageIndex, int pageSize) { if (headerCheck.CheckSoapHeader(myHeader, true)) { IMobileAppDataObtianProxy obtainProxy = new MobileAppDataWCFProxy(myHeader.SchoolNum); string r = obtainProxy.GetViolationLog(studentNo, pageIndex, pageSize); obtainProxy.Dispose(); return(r); } AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "权限验证失败!"; return(JSONSerializer.Serialize(result)); }
public string GetOftenSeat(string studentNo, int seatCount, int dayCount) { if (headerCheck.CheckSoapHeader(myHeader, true)) { IMobileAppDataObtianProxy obtainProxy = new MobileAppDataWCFProxy(myHeader.SchoolNum); string r = obtainProxy.GetOftenSeat(studentNo, seatCount, dayCount); obtainProxy.Dispose(); return(r); } AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "权限验证失败!"; return(JSONSerializer.Serialize(result)); }
public string GetLibraryNowState() { if (headerCheck.CheckSoapHeader(myHeader, true)) { IMobileAppDataObtianProxy obtainProxy = new MobileAppDataWCFProxy(myHeader.SchoolNum); string r = obtainProxy.GetLibraryNowState(); obtainProxy.Dispose(); // SeatManage.SeatManageComm.WriteLog.Write("r:"+r); return(r); } AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "权限验证失败!"; return(JSONSerializer.Serialize(result)); }
public string GetSeatBespeakInfo(string seatNo, string roomNo, string bespeakTime) { if (headerCheck.CheckSoapHeader(myHeader, true)) { WriteLog.Write(myHeader.SchoolNum); IMobileAppDataObtianProxy obtainProxy = new MobileAppDataWCFProxy(myHeader.SchoolNum); string r = obtainProxy.GetSeatBespeakInfo(seatNo, roomNo, bespeakTime); obtainProxy.Dispose(); return(r); } AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "权限验证失败!"; return(JSONSerializer.Serialize(result)); }
/// <summary> /// 获取预约记录 /// </summary> /// <param name="studentNo">学号</param> /// <param name="pageIndex">页索引</param> /// <param name="pageSize">每页显示条数</param> /// <returns></returns> public string GetBesapsekLog(string studentNo, int pageIndex, int pageSize) { AJM_HandleResult result = new AJM_HandleResult(); try { if (string.IsNullOrEmpty(studentNo)) { result.Result = false; result.Msg = "学号不能为空!"; return(JSONSerializer.Serialize(result)); } if (pageIndex < 0 || pageSize < 0) { result.Result = false; result.Msg = "页数和每页显示数目必须大于等于0"; return(JSONSerializer.Serialize(result)); } List <BespeakLogInfo> logInfos = SeatManageDateService.GetBespeakLogsByPage(studentNo, pageIndex, pageSize); List <AJM_BespeakLog> ajmBespeakLogs = new List <AJM_BespeakLog>(); for (int i = 0; i < logInfos.Count; i++) { AJM_BespeakLog ajmBespeakLog = new AJM_BespeakLog(); ajmBespeakLog.Id = logInfos[i].BsepeaklogID; ajmBespeakLog.BookTime = logInfos[i].BsepeakTime.ToString("yyyy-MM-dd HH:mm:ss"); ajmBespeakLog.IsValid = logInfos[i].BsepeakState == BookingStatus.Waiting; ajmBespeakLog.Remark = logInfos[i].Remark; ajmBespeakLog.RoomName = logInfos[i].ReadingRoomName; ajmBespeakLog.RoomNo = logInfos[i].ReadingRoomNo; ajmBespeakLog.SeatShortNo = logInfos[i].ShortSeatNum; ajmBespeakLog.SeatNo = logInfos[i].SeatNo; ajmBespeakLog.SubmitDateTime = logInfos[i].SubmitTime.ToString("yyyy-MM-dd HH:mm:ss"); ajmBespeakLog.CancelTime = logInfos[i].CancelTime.ToString("yyyy-MM-dd HH:mm:ss"); ajmBespeakLogs.Add(ajmBespeakLog); } result.Result = true; result.Msg = JSONSerializer.Serialize(ajmBespeakLogs); return(JSONSerializer.Serialize(result)); } catch (Exception ex) { WriteLog.Write(string.Format("获取预约记录遇到异常:{0}", ex.Message)); result.Result = false; result.Msg = "获取预约记录执行异常!"; return(JSONSerializer.Serialize(result)); } }
/// <summary> /// 获取服务器时间 /// </summary> /// <returns></returns> public string GetServerTime() { AJM_HandleResult result = new AJM_HandleResult(); try { result.Result = true; result.Msg = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); return(JSONSerializer.Serialize(result)); } catch (Exception ex) { WriteLog.Write(string.Format("获取读者当前状态发生异常:{0}", ex.Message)); result.Result = false; result.Msg = "获取服务器时间执行异常!"; return(JSONSerializer.Serialize(result)); } }
public string GetUserInfo(string studentNo) { if (headerCheck.CheckSoapHeader(myHeader, true)) { IMobileAppDataObtianProxy obtainProxy = new MobileAppDataWCFProxy(myHeader.SchoolNum); // IMobileAppDataObtianProxy obtainProxy = new MobileAppDataWCFProxy("20171203"); string r = obtainProxy.GetUserInfo(studentNo); obtainProxy.Dispose(); WriteLog.Write(r); return(r); } WriteLog.Write("权限验证失败"); AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "权限验证失败!"; return(JSONSerializer.Serialize(result)); }
/// <summary> /// 获取黑名单记录 /// </summary> /// <param name="studentNo">学号</param> /// <param name="pageIndex">页索引</param> /// <param name="pageSize">每页显示条数</param> /// <returns></returns> public string GetBlacklist(string studentNo, int pageIndex, int pageSize) { AJM_HandleResult result = new AJM_HandleResult(); try { if (string.IsNullOrEmpty(studentNo)) { result.Result = false; result.Msg = "学号不能为空!"; return(JSONSerializer.Serialize(result)); } if (pageIndex < 0 || pageSize < 0) { result.Result = false; result.Msg = "页数和每页显示数目必须大于等于0"; return(JSONSerializer.Serialize(result)); } List <BlackListInfo> blackListInfos = SeatManageDateService.GetBlacklistInfosByPage(studentNo, pageIndex, pageSize); List <AJM_BlacklistLog> ajmBlacklistLogs = new List <AJM_BlacklistLog>(); for (int i = 0; i < blackListInfos.Count; i++) { AJM_BlacklistLog ajmBlacklistLog = new AJM_BlacklistLog(); ajmBlacklistLog.AddTime = blackListInfos[i].AddTime.ToString("yyyy-MM-dd HH:mm:ss"); ajmBlacklistLog.StudentNo = blackListInfos[i].CardNo; ajmBlacklistLog.ID = blackListInfos[i].ID; ajmBlacklistLog.IsValid = blackListInfos[i].BlacklistState == LogStatus.Valid; ajmBlacklistLog.OutBlacklistMode = blackListInfos[i].OutBlacklistMode.ToString(); ajmBlacklistLog.OutTime = blackListInfos[i].OutTime.ToString("yyyy-MM-dd HH:mm:ss"); ajmBlacklistLog.ReMark = blackListInfos[i].ReMark; ajmBlacklistLogs.Add(ajmBlacklistLog); } result.Result = true; result.Msg = JSONSerializer.Serialize(ajmBlacklistLogs); return(JSONSerializer.Serialize(result)); } catch (Exception ex) { WriteLog.Write(string.Format("查询黑名单遇到异常:{0}", ex.Message)); result.Result = false; result.Msg = "查询黑名单执行遇到异常!"; return(JSONSerializer.Serialize(result)); } }
/// <summary> /// 用户登录 /// </summary> /// <param name="loginId">登录账号</param> /// <param name="password">登录密码</param> /// <returns></returns> public string CheckUser(string loginId, string password) { AJM_HandleResult result = new AJM_HandleResult(); try { if (string.IsNullOrEmpty(loginId.Trim()) || string.IsNullOrEmpty(password.Trim())) { result.Result = false; result.Msg = "用户名或密码不能为空!"; return(JSONSerializer.Serialize(result)); } UserInfo userInfo = seatManageDateService.GetUserInfo(loginId); if (userInfo == null) { result.Result = false; result.Msg = "用户名或密码错误!"; return(JSONSerializer.Serialize(result)); } string md5Password = MD5Algorithm.GetMD5Str32(password); if (!md5Password.Equals(userInfo.Password)) { result.Result = false; result.Msg = "用户名或密码错误!"; return(JSONSerializer.Serialize(result)); } AJM_Reader ajmReader = new AJM_Reader { StudentNo = userInfo.LoginId, Name = userInfo.UserName }; result.Result = true; result.Msg = JSONSerializer.Serialize(ajmReader); return(JSONSerializer.Serialize(result)); } catch (Exception ex) { WriteLog.Write(string.Format("登录出现异常:{0}", ex.Message)); result.Result = false; result.Msg = "执行登录操作遇到异常"; return(JSONSerializer.Serialize(result)); } }
/// <summary> /// 预约座位 /// </summary> /// <param name="seatNo"></param> /// <param name="roomNo"></param> /// <param name="cardNo"></param> /// <param name="besapeakTime"></param> /// <param name="isNowBesapeak"></param> /// <param name="schoolNo"></param> /// <returns></returns> public string SubmitBesapeskSeat(string seatNo, string roomNo, string cardNo, string besapeakTime, bool isNowBesapeak, string schoolNo) { try { IMobileAppDataObtianProxy appService = new MobileAppDataObtainProxy(schoolNo); string result = appService.SubmitBesapeskSeat(seatNo, roomNo, cardNo, besapeakTime, isNowBesapeak); AJM_HandleResult ajmResult = JSONSerializer.Deserialize <AJM_HandleResult>(result); if (ajmResult == null) { throw new Exception("预约座位失败!"); } return(ajmResult.Msg); } catch (Exception ex) { WriteLog.Write("预约座位失败:" + ex.Message); throw ex; } }
/// <summary> /// 等待座位 /// </summary> /// <param name="studentNo_A"></param> /// <param name="studentNo_B"></param> /// <param name="seatNo"></param> /// <returns></returns> public string WaitSeat(string studentNo_A, string studentNo_B, string seatNo, string schoolNo) { try { IMobileAppDataObtianProxy appService = new MobileAppDataObtainProxy(schoolNo); string result = appService.WaitSeat(studentNo_A, studentNo_B, seatNo); AJM_HandleResult ajmResult = JSONSerializer.Deserialize <AJM_HandleResult>(result); if (ajmResult == null) { throw new Exception("等待座位失败!"); } return(ajmResult.Msg); } catch (Exception ex) { WriteLog.Write(string.Format("等待座位失败:{0}", ex.Message)); throw ex; } }
/// <summary> /// 预约签到 /// </summary> /// <param name="besapeakNo"></param> /// <returns></returns> public string ConfirmSeat(string besapeakNo, string schoolNo) { try { IMobileAppDataObtianProxy appService = new MobileAppDataObtainProxy(schoolNo); string result = appService.ConfirmSeat(besapeakNo); AJM_HandleResult ajmResult = JSONSerializer.Deserialize <AJM_HandleResult>(result); if (ajmResult == null) { throw new Exception("预约签到失败!"); } return(ajmResult.Msg); } catch (Exception ex) { WriteLog.Write(string.Format("预约签到失败:{0}", ex.Message)); throw ex; } }
/// <summary> /// 根据预约记录的ID取消预约 /// </summary> /// <param name="bespeakId"></param> /// <param name="schoolNo"></param> /// <returns></returns> public string CancelBesapeakById(int bespeakId, string schoolNo) { try { IMobileAppDataObtianProxy appService = new MobileAppDataObtainProxy(schoolNo); string result = appService.CancelBesapeak(bespeakId); AJM_HandleResult ajmResult = JSONSerializer.Deserialize <AJM_HandleResult>(result); if (ajmResult == null) { throw new Exception("取消预约失败!"); } return(ajmResult.Msg); } catch (Exception ex) { WriteLog.Write("取消预约失败:" + ex.Message); throw ex; } }
/// <summary> /// 根据读者学号取消当前的预约 /// </summary> /// <param name="cardNo">学号</param> /// <param name="bespeakDate">预约日期</param> /// <param name="schoolNo">学校编号</param> /// <returns></returns> public string CancelBesapeakByCardNo(string cardNo, string bespeakDate, string schoolNo) { try { IMobileAppDataObtianProxy appService = new MobileAppDataObtainProxy(schoolNo); string result = appService.CancelBesapeakByCardNo(cardNo, bespeakDate); AJM_HandleResult ajmResult = JSONSerializer.Deserialize <AJM_HandleResult>(result); if (ajmResult == null) { throw new Exception("根据学号取消当前预约失败!"); } return(ajmResult.Msg); } catch (Exception ex) { WriteLog.Write(string.Format("根据学号取消当前预约失败:{0}", ex.Message)); throw ex; } }
/// <summary> /// 扫描选座终端二维码操作 /// </summary> /// <param name="codeStr">扫描后的二维码</param> /// <param name="studentNo">学号</param> /// <param name="schoolNo"></param> /// <returns></returns> public string QRcodeOperation(string codeStr, string studentNo, string schoolNo) { try { IMobileAppDataObtianProxy appService = new MobileAppDataObtainProxy(schoolNo); string result = appService.QRcodeOperation(codeStr, studentNo); AJM_HandleResult ajmResult = JSONSerializer.Deserialize <AJM_HandleResult>(result); if (ajmResult == null) { throw new Exception("扫描终端二维码操作失败!"); } return(ajmResult.Msg); } catch (Exception ex) { WriteLog.Write(string.Format("扫描终端二维码操作失败:{0}", ex.Message)); return(null); } }
/// <summary> /// 暂离 /// </summary> /// <param name="cardNo"></param> /// <param name="schoolNo"></param> /// <returns></returns> public string ShortLeave(string cardNo, string schoolNo) { try { IMobileAppDataObtianProxy appService = new MobileAppDataObtainProxy(schoolNo); string result = appService.ShortLeave(cardNo); AJM_HandleResult ajmResult = JSONSerializer.Deserialize <AJM_HandleResult>(result); if (ajmResult == null) { throw new Exception("设置座位暂离失败!"); } return(ajmResult.Msg); } catch (Exception ex) { WriteLog.Write("设置座位暂离失败:" + ex.Message); throw ex; } }
/// <summary> /// 获取违规记录 /// </summary> /// <param name="studentNo">学号</param> /// <param name="pageIndex">页索引</param> /// <param name="pageSize">每页显示条数</param> /// <returns></returns> public string GetViolationLog(string studentNo, int pageIndex, int pageSize) { AJM_HandleResult result = new AJM_HandleResult(); try { if (string.IsNullOrEmpty(studentNo)) { result.Result = false; result.Msg = "学号不能为空"; JSONSerializer.Serialize(result); } if (pageIndex < 0 || pageSize < 0) { result.Result = false; result.Msg = "页数和每页显示数目必须大于等于0"; return(JSONSerializer.Serialize(result)); } List <ViolationRecordsLogInfo> violationRecordsLogInfos = SeatManageDateService.GetViolationRecordsLogsByPage(studentNo, pageIndex, pageSize); List <AJM_ViolationRecordsLogInfo> ajmViolationRecordsLogInfos = new List <AJM_ViolationRecordsLogInfo>(); for (int i = 0; i < violationRecordsLogInfos.Count; i++) { AJM_ViolationRecordsLogInfo ajmViolationRecordsLogInfo = new AJM_ViolationRecordsLogInfo(); ajmViolationRecordsLogInfo.StudentNo = violationRecordsLogInfos[i].CardNo; ajmViolationRecordsLogInfo.EnterOutTime = violationRecordsLogInfos[i].EnterOutTime; ajmViolationRecordsLogInfo.RoomName = violationRecordsLogInfos[i].ReadingRoomName; ajmViolationRecordsLogInfo.Remark = violationRecordsLogInfos[i].Remark; ajmViolationRecordsLogInfo.SeatNo = violationRecordsLogInfos[i].SeatID; ajmViolationRecordsLogInfos.Add(ajmViolationRecordsLogInfo); } result.Result = true; result.Msg = JSONSerializer.Serialize(ajmViolationRecordsLogInfos); return(JSONSerializer.Serialize(result)); } catch (Exception ex) { WriteLog.Write(string.Format("查询违规记录遇到异常:{0}", ex.Message)); result.Result = false; result.Msg = "查询违规记录执行遇到异常!"; return(JSONSerializer.Serialize(result)); } }
/// <summary> /// 根据阅览室编号获取但个阅览室当前开闭状态 /// </summary> /// <returns></returns> public static string GetSingleRoomOpenState(string roomNo, string datetime, string endPortAddress) { IWeChatWcfService.IWeChatService weCharService = WeChatWcfChannel.ServiceProxy.CreateChannelSeatManageService(endPortAddress); try { return(weCharService.GetSingleRoomOpenState(roomNo, datetime)); } catch (Exception ex) { WriteLog.Write("根据阅览室编号获取但个阅览室当前开闭状态操作失败:" + ex.Message); AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "对不起,数据连接失败,请稍后重试。"; return(JSONSerializer.Serialize(result)); } finally { ICommunicationObject ICommObjectService = weCharService as ICommunicationObject; try { if (ICommObjectService != null && ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { if (ICommObjectService != null) { ICommObjectService.Close(); } } } catch { if (ICommObjectService != null) { ICommObjectService.Abort(); } } } }
/// <summary> /// 验证用户信息 /// </summary> /// <param name="loginId"></param> /// <param name="password"></param> /// <returns></returns> public static string CheckUser(string loginId, string password, string endPortAddress) { IWeChatWcfService.IWeChatService weCharService = WeChatWcfChannel.ServiceProxy.CreateChannelSeatManageService(endPortAddress); try { return(weCharService.CheckUser(loginId, password)); } catch (Exception ex) { WriteLog.Write("验证用户信息操作失败:" + ex.Message); AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "对不起,数据连接失败,请稍后重试。"; return(JSONSerializer.Serialize(result)); } finally { ICommunicationObject ICommObjectService = weCharService as ICommunicationObject; try { if (ICommObjectService != null && ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { if (ICommObjectService != null) { ICommObjectService.Close(); } } } catch { if (ICommObjectService != null) { ICommObjectService.Abort(); } } } }
/// <summary> /// 预约提交 /// </summary> /// <param name="seatNo">座位编号(9位)</param> /// <param name="roomNo">阅览室编号</param> /// <param name="studentNo">学生学号</param> /// <param name="besapeakTime">预约的时间(立即预约次处值无效可为空)</param> /// <param name="isNowBesapeak">是否是立即预约</param> /// <returns></returns> public static string SubmitBesapeskSeat(string seatNo, string roomNo, string studentNo, string besapeakTime, bool isNowBesapeak, string endPortAddress) { IWeChatWcfService.IWeChatService weCharService = WeChatWcfChannel.ServiceProxy.CreateChannelSeatManageService(endPortAddress); try { return(weCharService.SubmitBesapeskSeat(seatNo, roomNo, studentNo, besapeakTime, isNowBesapeak)); } catch (Exception ex) { WriteLog.Write("预约提交操作失败:" + ex.Message); AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "对不起,数据连接失败,请稍后重试。"; return(JSONSerializer.Serialize(result)); } finally { ICommunicationObject ICommObjectService = weCharService as ICommunicationObject; try { if (ICommObjectService != null && ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { if (ICommObjectService != null) { ICommObjectService.Close(); } } } catch { if (ICommObjectService != null) { ICommObjectService.Abort(); } } } }
/// <summary> /// 获取预约记录 /// </summary> /// <param name="studentNo">用户学号</param> /// <param name="pageIndex">页编码</param> /// <param name="pageSize">每页数目</param> /// <returns></returns> public static string GetBesapsekLog(string studentNo, int pageIndex, int pageSize, string endPortAddress) { IWeChatWcfService.IWeChatService weCharService = WeChatWcfChannel.ServiceProxy.CreateChannelSeatManageService(endPortAddress); try { return(weCharService.GetBesapsekLog(studentNo, pageIndex, pageSize)); } catch (Exception ex) { WriteLog.Write("获取预约记录操作失败:" + ex.Message); AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "对不起,数据连接失败,请稍后重试。"; return(JSONSerializer.Serialize(result)); } finally { ICommunicationObject ICommObjectService = weCharService as ICommunicationObject; try { if (ICommObjectService != null && ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { if (ICommObjectService != null) { ICommObjectService.Close(); } } } catch { if (ICommObjectService != null) { ICommObjectService.Abort(); } } } }
/// <summary> /// 根据学号和日期取消预约 /// </summary> /// <param name="studentNo">学号</param> /// <param name="bespeakDate">预约日期</param> /// <returns></returns> public static string CancelBespeakLogByCardNo(string studentNo, string bespeakDate, string endPortAddress) { IWeChatWcfService.IWeChatService weCharService = WeChatWcfChannel.ServiceProxy.CreateChannelSeatManageService(endPortAddress); try { return(weCharService.CancelBespeakLogByCardNo(studentNo, bespeakDate)); } catch (Exception ex) { WriteLog.Write("根据学号和日期取消预约操作失败:" + ex.Message); AJM_HandleResult result = new AJM_HandleResult(); result.Result = false; result.Msg = "对不起,数据连接失败,请稍后重试。"; return(JSONSerializer.Serialize(result)); } finally { ICommunicationObject ICommObjectService = weCharService as ICommunicationObject; try { if (ICommObjectService != null && ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { if (ICommObjectService != null) { ICommObjectService.Close(); } } } catch { if (ICommObjectService != null) { ICommObjectService.Abort(); } } } }