/// <summary> /// 添加设备信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public static Model.Enum.HandleResult AddDeviceModel(Model.AMS_Device model) { AMS.IBllService.IAdvertManageBllService bllService = AMS.ServiceConnectChannel.AdvertManageBllServiceChannel.CreateServiceChannel(); bool error = false; try { return(bllService.AddDeviceModel(model)); } catch (Exception ex) { error = true; SeatManage.SeatManageComm.WriteLog.Write(string.Format("添加设备信息遇到错误,异常来自:{0};信息:{1}", ex.Source, ex.Message)); throw ex; } finally { ICommunicationObject ICommObjectService = bllService as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }