Exemplo n.º 1
0
        public static bool Add(FileUpdateInfo model)
        {
            IWCFService.ISeatManageService service = new WcfServiceForSeatManage.SeatManageDateService();
            bool isError = false;

            try
            {
                return(service.AddUpdaterFileInfo(model));
            }
            catch (Exception ex)
            {
                isError = true;
                WriteLog.Write(string.Format("添加出错,异常信息:{0}", ex.Message));
                throw ex;
            }
            finally
            {
                ICommunicationObject ICommObjectService = service as ICommunicationObject;
                try
                {
                    if (ICommObjectService.State == CommunicationState.Faulted)
                    {
                        ICommObjectService.Abort();
                    }
                    else
                    {
                        ICommObjectService.Close();
                    }
                }
                catch
                {
                    ICommObjectService.Abort();
                }
            }
        }