예제 #1
0
        private void btnApply_Click(object sender, EventArgs e)
        {
            string reportInbox = tbxReportPath.Text;

            if (!Directory.Exists(reportInbox))
            {
                MessageBox.Show("报告路径不存在");
                return;
            }

            string serverIP         = tbxServerIP.Text;
            string serverPort       = tbxServerPort.Text;
            bool   bConfirmOKReport = cbxConfirmOKReport.Checked;

            ConfigurationManager.AppSettings["ReportInbox"]         = reportInbox;
            ConfigurationManager.AppSettings["ServerIP"]            = serverIP;
            ConfigurationManager.AppSettings["ServerPort"]          = serverPort;
            ConfigurationManager.AppSettings["NeedConfirmOkReport"] = bConfirmOKReport ? "1" : "0";

            ReportClient.Stop();

            int nPort = 11121;

            int.TryParse(serverPort, out nPort);

            ReportClient.ServerIP             = serverIP;
            ReportClient.ServerPort           = nPort;
            ReportClient.PdfReportFolder      = reportInbox;
            ReportClient.LogPath              = @"C:\ReportLog\Client";
            ReportClient.NeedConfirmPatientId = bConfirmOKReport;

            ReportClient.Start();

            HideForm();
        }
예제 #2
0
        private void notifyIcon_MouseMove(object sender, MouseEventArgs e)
        {
            ReportInfo report = ReportClient.GetReportNeedConfirm();

            if (report != null)
            {
                this.notifyIcon.ShowBalloonTip(10000, "请确认报告信息", "v1.0.0", ToolTipIcon.Warning);
            }
        }
예제 #3
0
 private void timer_Tick(object sender, EventArgs e)
 {
     //check usb at specified folder
     if (IsUSBAlive())
     {
         ReportClient.Start();
     }
     else
     {
         ReportClient.Stop();
     }
 }
예제 #4
0
        void ReportClient_ReportSendEventHandler(ReportSendEventArg arg)
        {
            if (arg.HasError)
            {
                this.notifyIcon.ShowBalloonTip(2000, arg.ErrorMessage, "v1.0.0", ToolTipIcon.Info);
                return;
            }

            ReportInfo report = arg.Report;

            if (report.NeedConfirm())
            {
                //should notify UI and let doctor to decide, now just test without UI
                if (report.Status == ReportStatus.FailedGetPatientId)
                {
                    report.PatientId = "newPatientID";
                    report.Status    = ReportStatus.SubmitNewPatientId;

                    this.notifyIcon.ShowBalloonTip(10000, "请手动输入病人Id", "v1.0.0", ToolTipIcon.Error);
                }
                else if (report.Status == ReportStatus.ConfirmPatientId)
                {
                    report.Status = ReportStatus.SubmitOK;
                    this.notifyIcon.ShowBalloonTip(10000, "请确认报告信息", "v1.0.0", ToolTipIcon.Warning);
                }
                else if (report.Status == ReportStatus.ConfirmExistReport)
                {
                    report.ExistReportAction = ExistReportAction.Append;
                    report.Status            = ReportStatus.SubmitExistReportAction;

                    this.notifyIcon.ShowBalloonTip(10000, "请确认报告信息", "v1.0.0", ToolTipIcon.Warning);
                }

                ReportClient.SetReportConfirmed(report);
            }
            else if (report.HasError())
            {
                this.notifyIcon.ShowBalloonTip(2000, report.ErrorMessage, "v1.0.0", ToolTipIcon.Info);
            }
            else if (report.IsServerDone())
            {
                this.notifyIcon.ShowBalloonTip(5000, "报告提交成功", "v1.0.0", ToolTipIcon.Info);
            }
        }