/// <summary> /// 根据校区编号查看设备信息 /// </summary> /// <param name="schoolNum"></param> /// <param name="flag"></param> /// <returns></returns> public static List <AdvertManage.Model.AMS_DeviceModel> GeDeviceModelByCampusNum(string campusNum) { IWCFService.IAdvertManageService advertService = WcfAccessProxy.AMS_ServiceProxy.CreateChannelAdvertManageService(); bool error = false; try { return(advertService.GeDeviceModelByCampusNum(campusNum)); } catch (Exception ex) { error = true; SeatManage.SeatManageComm.WriteLog.Write(string.Format("根据校区编号查看设备信息遇到错误,异常来自:{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(); } } }