private void InsertElementText(PadForm padForm, string name, string diagContent) { ArrayList al = new ArrayList(); padForm.zyEditorControl1.EMRDoc.GetAllSpecElement(al, padForm.zyEditorControl1.EMRDoc.RootDocumentElement, ElementType.Text, name); if (al.Count > 0) { ZYText find = al[0] as ZYText; if (find != null) { padForm.zyEditorControl1.EMRDoc.Content.MoveSelectStart(find.FirstElement); padForm.zyEditorControl1.DeleteElement(find); } } else { //padForm.zyEditorControl1.EMRDoc._MoveRight(); } ZYText value = new ZYText(); value.Name = name; value.Text = diagContent; value.Attributes.SetValue(ZYTextConst.c_FontSize, "小四"); padForm.zyEditorControl1.EMRDoc._InsertBlock(value); }
private void InsertString(PadForm padForm, string name, string diagContent) { try { padForm.zyEditorControl1.EMRDoc._MoveRight(); padForm.zyEditorControl1.EMRDoc._InserString(diagContent); } catch (Exception) { throw; } }
/// <summary> /// 得到界面返回的值 /// </summary> /// <returns></returns> public void GetDiag(PadForm padForm) { if (m_Form is DiagForm) { string diagContent = m_DiagForm.GetDiag().Trim(); InsertElementText(padForm, m_Name, diagContent); } else if (m_Form is DiagLibForm) { string diagContent = m_DiagLibForm.GetDiag().Trim(); InsertString(padForm, m_Name, diagContent); } }
/// <summary> /// 得到界面返回的值 /// </summary> /// 二次修改 杨伟康 (满足浦口需求) /// <returns></returns> public void GetDiag(PadForm padForm) { try { //此处根据配置,判断返回的诊断内容是结构化元素还是自由文本 //add by ywk 2013年2月19日15:46:13 string diagContentType = BasicSettings.GetStringConfig("IsSetDiagContentStr") == "" ? "1" : BasicSettings.GetStringConfig("IsSetDiagContentStr"); if (m_Form is DiagForm) { string diagContent = m_DiagForm.GetDiag().Trim(); //edti by ywk 2013年2月19日15:50:39 if (diagContentType == "1")//插入结构化元素 { InsertElementText(padForm, m_Name, diagContent); } else { InsertString(padForm, m_Name, diagContent); //InsertElementText(padForm, m_Name, diagContent); } } else // 手术信息 if (m_Form is OperForm) { string diagContent = m_OperForm.GetDiag().Trim(); //edti by ywk 2013年2月19日15:50:39 if (diagContentType == "1") //插入结构化元素 { InsertElementText(padForm, m_Name, diagContent); } else { InsertString(padForm, m_Name, diagContent); //InsertElementText(padForm, m_Name, diagContent); } } else if (m_Form is DiagLibForm) { string diagContent = m_DiagLibForm.GetDiag().Trim(); InsertString(padForm, m_Name, diagContent); } } catch (Exception) { throw; } }
private void InsertString(PadForm padForm, string name, string diagContent) { padForm.zyEditorControl1.EMRDoc._MoveRight(); padForm.zyEditorControl1.EMRDoc._InserString(diagContent); }
public static void Start() { LogHelper.LogInfo("Release version"); try { Application.ThreadException += (sender, e) => LogHelper.LogError(e.Exception); AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs e) { LogHelper.LogInfo("未捕获的异常"); LogHelper.LogInfo(e); }; } catch (Exception exception) { LogHelper.LogInfo("标准异常"); LogHelper.LogError(exception); new ShowErrorMessageForm { exp = exception, StartPosition = FormStartPosition.CenterScreen, ecInfo = exception.ToString() }.ShowDialog(); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Process instance = RunningInstance(); if (instance == null) { string str; LogHelper.InitLog(); ConfigHelper.Init(); bool flag = true; if (CheckRegister.GetRegisterCodeFromConfig(out str)) { PadForm.orgid = str; // 取得注册信息 string regValue = ""; string softDirectory = "C:\\Windows\\KangShuo\\client.key"; if (File.Exists(softDirectory)) { StreamReader sr = new StreamReader(softDirectory); regValue = sr.ReadLine(); sr.Close(); } // 根据CPU、硬盘、主板信息生成注册码 string deviceId = CheckRegister.GetDeviceId(); // 判断注册信息是否一致 if (!regValue.Equals(deviceId)) { MessageBox.Show("错误的注册码!请重新注册!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Hand); return; } } SystemDetectionForm diagnostics = new SystemDetectionForm(); if (diagnostics.ShowDialog() != DialogResult.OK) { return; } PadForm form2 = new PadForm { readCard = diagnostics.ck }; using (PadForm form = form2) { form.FormClosed += (sender, e) => Environment.Exit(0); Application.Run(form); return; } } HandleRunningInstance(instance); }