/// <summary> /// 根据学校编号获取有效的下发记录 /// </summary> /// <param name="schoolNum"></param> /// <returns></returns> public static List <AdvertManage.Model.AMS_CommandListModel> GetCommandListBySchoolNum(string schoolNum) { IWCFService.IAdvertManageService advertService = WcfAccessProxy.AMS_ServiceProxy.CreateChannelAdvertManageService(); bool error = false; try { return(advertService.GetCommandListBySchoolNum(schoolNum)); } catch (Exception ex) { error = true; SeatManage.SeatManageComm.WriteLog.Write(string.Format("根据Id获取下发记录失败,异常来自:{0};信息:{1}", ex.Source, ex.Message)); throw ex; } finally { ICommunicationObject ICommObjectService = advertService as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }