Exemple #1
0
        /// <summary>
        /// 登陆时操作员列表显示
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CFormOperatorManage_Load(object sender, EventArgs e)
        {
            if (!CStaticClass.CheckPushService())
            {// 检查服务
                return;
            }

            QueryServiceClient proxy = new QueryServiceClient();

            try
            {
                // 查询所有操作员信息(除天达维护人员)
                List <COperatorDto> lstOperatorDto = new List <COperatorDto>();
                proxy.GetOperatorList(ref lstOperatorDto);
                lstOperatorDto = lstOperatorDto.FindAll(s => (EnmOperatorType)s.opttype != EnmOperatorType.CIMCWorker);
                // 添加列表信息
                this.DgvOperator.DataSource = new BindingList <COperatorDto>(lstOperatorDto);
            }
            catch (TimeoutException)
            {
                MessageBox.Show("The service operation timed out. ", "超时", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (FaultException exception)
            {
                MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "SOAP错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (CommunicationException exception)
            {
                MessageBox.Show("There was a communication problem. " + CStaticClass.GetExceptionInfo(exception), "通信错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception exception)
            {
                MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "应用程序异常", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            proxy.Close();
        }