Example #1
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     try
     {
         if (null == DeviceState.SendPrintState())
         {
             Util.JumpUtil.jumpCommonPage("FormRegistrationHospital_1");
             return;
         }
         else
         {
             Util.JumpUtil.jumpCommonPage("FormPrintError");
             return;
         }
     }
     catch (Exception ex)
     {
         log.Write("error:FormRegistration:Button_Click_1:" + ex.Message);
     }
 }
Example #2
0
 private void Button_Click_4(object sender, RoutedEventArgs e)
 {
     try {
         if (isPrint == false)
         {
             return;
         }
         if (printThread != null)
         {
             printThread.Abort();
             printThread.DisableComObjectEagerCleanup();
             printThread = null;
         }
         printThread = new Thread(delegate() {
             showInfo("正在检测,请稍后...");
             //打印机
             Thread.Sleep(1000);
             string str = DeviceState.SendPrintState();
             if (str == null)
             {
                 setTextBlockText(printlbl, "正常");
             }
             else
             {
                 setTextBlockText(printlbl, "异常:" + str.Remove(0, 2) + " " + ExceptionInfo(str));
             }
             showInfo("设备状态");
         });
         printThread.Start();
     }
     catch (ThreadAbortException ae) { log.Write("error:" + ae.Message); }
     catch (Exception ex)
     {
         log.Write("error:" + ex.Message);
     }
 }
Example #3
0
        private void checkState()
        {
            try
            {
                string str = DeviceState.SendCRT310State();
                if (str == null)
                {
                    setTextBlockText(crt310lbl, "正常");
                }
                else
                {
                    setTextBlockText(crt310lbl, "异常:" + str.Remove(0, 2) + " " + ExceptionInfo(str));
                }

                str = DeviceState.SendZT598State();
                if (str == null)
                {
                    setTextBlockText(zt598lbl, "正常");
                }
                else
                {
                    setTextBlockText(zt598lbl, "异常:" + str.Remove(0, 2) + " " + ExceptionInfo(str));
                }

                str = DeviceState.SendPrintState();
                if (str == null)
                {
                    setTextBlockText(printlbl, "正常");
                }
                else
                {
                    setTextBlockText(printlbl, "异常:" + str.Remove(0, 2) + " " + ExceptionInfo(str));
                }

                str = DeviceState.SendCJ201State();
                if (str == null)
                {
                    setTextBlockText(cj201lbl, "正常");
                }
                else
                {
                    setTextBlockText(cj201lbl, "异常:" + str.Remove(0, 2) + " " + ExceptionInfo(str));
                }

                str = DeviceState.SendCRT603State();
                if (str == null)
                {
                    setTextBlockText(crt603lbl, "正常");
                }
                else
                {
                    setTextBlockText(crt603lbl, "异常:" + str.Remove(0, 2) + " " + ExceptionInfo(str));
                }

                showInfo("设备状态");
            }
            catch (Exception ex)
            {
                log.Write("error:设备检测异常:" + ex.Message);
                showInfo("设备检测异常");
            }
        }