private int GetTimerInterval() { string YqXmlPath = GetYqXmlPath(); if (string.IsNullOrEmpty(YqXmlPath)) { return(5000); } return(int.Parse(xmlrw.GetValueFormXML(YqXmlPath, "YQ_Interval")) * 1000); }
/// <summary> /// 设定仪器的型号 /// </summary> /// <param name="yqxh"></param> /// <returns></returns> public override bool setStart(string yqxhPara) { string YqXmlPath = ""; string YQ_Interval = ""; string YQ_DateType = ""; Jktj_lis = new lis_new(); //xmlpath YqXmlPath = Common.getyqPath(yqxhPara); //jg数据处理间隔时间 YQ_Interval = XmlRW.GetValueFormXML(YqXmlPath, "YQ_Interval", "value"); //rqlx 标本日期类型 YQ_DateType = XmlRW.GetValueFormXML(YqXmlPath, "YQ_DateType", "value"); timer_lis.Enabled = false; yqxh = yqxhPara; if (yqxh.Length > 0) { if (YQ_Interval.Equals("0")) { timer_lis.Interval = 5000; } else { timer_lis.Interval = int.Parse(YQ_Interval) * 1000; } timer_lis.Enabled = true; } return(true); }
/// <summary> /// 设定仪器的型号 /// </summary> /// <param name="yqxh"></param> /// <returns></returns> public override bool setStart(string yqxhPara) { string YqXmlPath = ""; string YQ_Interval = ""; Jktj_lis = new lis_new(); //xmlpath YqXmlPath = Common.getyqPath(yqxhPara); //jg数据处理间隔时间 YQ_Interval = XmlRW.GetValueFormXML(YqXmlPath, "YQ_Interval", "value"); yqxh = yqxhPara; if (yqxh.Length > 0) { if (YQ_Interval != "0") { _interval = int.Parse(YQ_Interval) * 1000; } _needToOperation = true; } Operation(new OpInfo(DateTime.Now.ToString("yyyy-MM-dd"), DateTime.Now.ToString("yyyy-MM-dd"), "0")); return(true); }
public static string GetYQType(string yqxh) { string xmlPath = Common.Common.getyqPath(yqxh); XmlRW xmlrw = new XmlRW(); return(xmlrw.GetValueFormXML(xmlPath, "YQ_YQType")); }
private string GetYqType() { string xmlPath = Common.getyqPath(yqxh); XmlRW BC = new XmlRW(); string YQ_YQtype = BC.GetValueFormXML(xmlPath, "YQ_YQType"); return(YQ_YQtype); }
private string GetYqType() { string xmlPath = TJClient.Common.Common.getyqPath(yqxh); XmlRW rw = new XmlRW(); string YQ_YQtype = rw.GetValueFormXML(xmlPath, "YQ_YQType"); return(YQ_YQtype); }
/// <summary> /// 窗体初始化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void printSet_load(object sender, EventArgs e) { //从字典表中取得打印机类型列表 DBAccess dBAccess = new DBAccess(); DataTable dtPrintList = TJClient.Common.Common.getsjzd("printFileType", "sql_select_sjzd"); if (dtPrintList != null && dtPrintList.Rows.Count > 0) { comboBox_printType.DataSource = dtPrintList; comboBox_printType.DisplayMember = "ZDMC"; comboBox_printType.ValueMember = "ZDBM"; } //已设定的打印机 XmlRW xmlWrite = new XmlRW(); string printName = xmlWrite.GetValueFormXML("UserConfig.xml", comboBox_printType.SelectedValue.ToString()); string print_view = xmlWrite.GetValueFormXML("UserConfig.xml", comboBox_printType.SelectedValue.ToString() + "_view"); if (print_view.ToLower().Equals("true")) { checkBox_view.Checked = true; } else { checkBox_view.Checked = false; } //获得系统中的打印机列表 List <String> list = LocalPrinter.GetLocalPrinters(); foreach (String s in list) { //将打印机名称添加到下拉框中 comboBox_sysPrint.Items.Add(s); if (s.Equals(printName)) { comboBox_sysPrint.Text = printName; } } comboBox_printType.Focus(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void comboBox_printType_SelectedIndexChanged(object sender, EventArgs e) { try { XmlRW xmlWrite = new XmlRW(); comboBox_sysPrint.Text = xmlWrite.GetValueFormXML("UserConfig.xml", comboBox_printType.SelectedValue.ToString()); string print_view = xmlWrite.GetValueFormXML("UserConfig.xml", comboBox_printType.SelectedValue.ToString() + "_view"); if (print_view.ToLower().Equals("true")) { checkBox_view.Checked = true; } else { checkBox_view.Checked = false; } } catch { } }
public static string GetYqDateType(string yqxh) { string YqXmlPath = GetYqXmlPath(yqxh); if (string.IsNullOrEmpty(YqXmlPath)) { return(""); } XmlRW xmlrw = new XmlRW(); return(xmlrw.GetValueFormXML(YqXmlPath, "YQ_DateType")); }
public static int GetTimerInterval(string yqxh) { string YqXmlPath = GetYqXmlPath(yqxh); if (string.IsNullOrEmpty(YqXmlPath)) { return(5000); } XmlRW xmlrw = new XmlRW(); return(int.Parse(xmlrw.GetValueFormXML(YqXmlPath, "YQ_Interval")) * 1000); }
/// <summary> /// 打印处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button_print_Click(object sender, EventArgs e) { //备份打印文件 copyDirectory(Path.GetDirectoryName(strFileName), Path.GetFileName(strFileName), Path.GetDirectoryName(strFileName) + "backup" + "//" + DateTime.Now.ToString("yyyyMM") + "//", UserInfo.Yybm + DateTime.Now.ToString("yyyy-MMddHHmmssfff") + "_" + Path.GetFileName(strFileName)); //指定打印机打印 XmlRW xml = new XmlRW(); printDemo.printList(xml.GetValueFormXML(printSetdoc, printName)); //设定回默认的打印机 printDemo.setPrint(printDemo.defaultPrintName); }
private DataTable GetDataTable(string paratime, out string errMsg) { DataTable dt = null; errMsg = ""; if (yqDemo != null) { if (yqDemo.IsOpen(out errMsg) == false) { yqDemo.open(out errMsg); } dt = yqDemo.YQDataReturn(paratime, out errMsg); } else { if (yqxh.Trim().Length == 0) { return(dt); } if (yqDemo == null) { string yqVersion = XmlRW.GetValueFormXML(Common.getyqPath(yqxh), "YQ_Version", "value"); yqDemo = LisFactory.LisCreate(yqVersion); } if (yqDemo.IsOpen(out errMsg) == false) { yqDemo.open(out errMsg); } dt = yqDemo.YQDataReturn(paratime, out errMsg); } return(dt); }
/// <summary> /// 获取结果 /// </summary> /// <returns></returns> public DataTable dataRecive_again() { DataTable dt = null; string errMsg = ""; try { string paratime = ""; //开始时间 if (dateTimePicker_start.Checked == true) { paratime = paratime + dateTimePicker_start.Value.ToString("yyyy-MM-dd") + " 00:00:00" + "|"; } //结束时间 if (dateTimePicker_end.Checked == true) { if (paratime.Length > 0) { paratime = paratime + dateTimePicker_end.Value.ToString("yyyy-MM-dd") + " 23:59:59"; } else { paratime = paratime + "|" + dateTimePicker_end.Value.ToString("yyyy-MM-dd") + " 23:59:59"; } } if (paratime.Length == 0) { paratime = DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00" + "|"; } //0:获取新数据 1:获取所有数据 paratime = paratime + "|" + "1"; if (yqDemo != null) { if (yqDemo.IsOpen(out errMsg) == false) { yqDemo.open(out errMsg); } dt = yqDemo.YQDataReturn(paratime, out errMsg); } else { if (yqxh.Trim().Length == 0) { timer_lis.Enabled = false; return(null); } if (yqDemo == null) { string yqVersion = XmlRW.GetValueFormXML(Common.getyqPath(yqxh), "YQ_Version", "value"); yqDemo = LisFactory.LisCreate(yqVersion); } if (yqDemo.IsOpen(out errMsg) == false) { yqDemo.open(out errMsg); } dt = yqDemo.YQDataReturn(paratime, out errMsg); } //将取得的结果保存到数据库中 if (dt != null && dt.Rows.Count > 0) { if (!dt.Columns.Contains("yybm")) { DataColumn dtcolumn = new DataColumn("yybm"); dtcolumn.DefaultValue = UserInfo.Yybm; dt.Columns.Add(dtcolumn); } if (!dt.Columns.Contains("yq")) { DataColumn dtcolumn = new DataColumn("yq"); dtcolumn.DefaultValue = timer_lis; dt.Columns.Add(dtcolumn); } //再次处理 //将获得的结果匹配体检表中的心电图的结果 dt = dt_pp(dt); DataTable dt_again = dt.Clone(); DataRow[] dtrow_again = dt.Select(" qf='1'"); if (dtrow_again.Length > 0) { for (int i = 0; i < dtrow_again.Length; i++) { dt_again.ImportRow(dtrow_again[i]); } } //新数据 DataTable dt_new = dt.Clone(); DataRow[] dtrow_new = dt.Select(" qf='2'"); if (dtrow_new.Length > 0) { for (int i = 0; i < dtrow_new.Length; i++) { dt_new.ImportRow(dtrow_new[i]); //置变量,以后不再读取此记录 MedExSqlHelper DBF = new MedExSqlHelper(); DBF.ExecuteNonQuery("update PACS_APPLY set work_status = 1 where PATIENT_ID = '" + dtrow_new[i]["ybh"].ToString() + "'"); } } Form_lisBll form_lisbll = new Form_lisBll(); if (dt_new != null && dt_new.Rows.Count > 0) { form_lisbll.Add(dt, "sql042"); string xmlPath = Common.getyqPath("MECG200"); string YQ_YQtype = XmlRW.GetValueFormXML(xmlPath, "YQ_YQType", "value"); button_save_sys(dt, YQ_YQtype); } if (dt_again != null && dt_again.Rows.Count > 0) { //更新数据 form_lisbll.Upd_all(dt_again, "sql042_update"); string xmlPath = Common.getyqPath("MECG200"); string YQ_YQtype = XmlRW.GetValueFormXML(xmlPath, "YQ_YQType", "value"); //更新数据 button_save_sys_again(dt_again, YQ_YQtype); } } } catch (Exception ex) { timer_lis.Enabled = false; Jktj_lis.msgShow(ex.Message); } return(dt); }
/// <summary> /// 仪器参数初始化 /// </summary> /// <returns></returns> public bool initYqpz() { string YqXmlPath = ""; try { //if (System.Configuration.ConfigurationSettings.AppSettings[comboBox_yq.SelectedValue.ToString()] == null) //{ // return false; //} ////xmlpath //YqXmlPath = System.Configuration.ConfigurationSettings.AppSettings[comboBox_yq.SelectedValue.ToString()].ToString(); if (Common.Common.getyqPath(comboBox_yq.SelectedValue.ToString()).Length <= 0) { MessageBox.Show("配置文件不存在!"); return(false); } //xmlpath YqXmlPath = Common.Common.getyqPath(comboBox_yq.SelectedValue.ToString()); //端口 comboBox_dk.Text = XmlRW.GetValueFormXML(YqXmlPath, "YQ_COM", "value"); //波特率 setDrpValue(comboBox_btl, XmlRW.GetValueFormXML(YqXmlPath, "YQ_BaudRate", "value")); //数据位 setDrpValue(comboBox_sjw, XmlRW.GetValueFormXML(YqXmlPath, "YQ_DataBits", "value")); //奇偶校验 setDrpValue(comboBox_jojy, XmlRW.GetValueFormXML(YqXmlPath, "YQ_Parity", "value")); //停止位 setDrpValue(comboBox_tzw, XmlRW.GetValueFormXML(YqXmlPath, "YQ_StopBits", "value")); //jg数据处理间隔时间 textBox_jg.Text = XmlRW.GetValueFormXML(YqXmlPath, "YQ_Interval", "value"); //rqlx 标本日期类型 if (XmlRW.GetValueFormXML(YqXmlPath, "YQ_DateType", "value").Equals("1")) { checkBox_bbrq.Checked = true; } else { checkBox_bbrq.Checked = false; } //写超时时间(豪秒) textBox_writetimeout.Text = XmlRW.GetValueFormXML(YqXmlPath, "YQ_writetimeout", "value"); //读超时时间(豪秒) textBox_readtimeout.Text = XmlRW.GetValueFormXML(YqXmlPath, "YQ_readtimeout", "value"); //解码程序版本 richTextBox_version.Text = XmlRW.GetValueFormXML(YqXmlPath, "YQ_Version", "value"); //注册码 textBox_register.Text = XmlRW.GetValueFormXML(YqXmlPath, "YQ_RegisterCode", "value"); //显示仪器标识 string keyCode = "gwtjyq"; textBox_registerid.Text = redKey(keyCode); } catch (Exception ex) { MessageBox.Show(ex.Message); } return(true); }
/// <summary> /// 获取结果 /// </summary> /// <returns></returns> public DataTable dataRecive() { DataTable dt = null; string errMsg = ""; try { if (yqDemo != null) { if (yqDemo.IsOpen(out errMsg) == false) { yqDemo.open(out errMsg); } dt = yqDemo.YQDataReturn(DateTime.Now.ToString("yyyy-MM-dd"), out errMsg); } else { if (yqxh.Trim().Length == 0) { timer_lis.Enabled = false; //MessageBox.Show("请选择仪器!"); return(null); } if (yqDemo == null) { if (Common.getyqPath(yqxh).Length <= 0) { MessageBox.Show("仪器配置文件不存在!"); return(null); } string yqVersion = XmlRW.GetValueFormXML(Common.getyqPath(yqxh), "YQ_Version", "value"); yqDemo = LisFactory.LisCreate(yqVersion); } if (yqDemo.IsOpen(out errMsg) == false) { yqDemo.open(out errMsg); } dt = yqDemo.YQDataReturn(DateTime.Now.ToString("yyyy-MM-dd"), out errMsg); } //将取得的结果保存到数据库中 if (dt != null) { if (!dt.Columns.Contains("yybm")) { DataColumn dtcolumn = new DataColumn("yybm"); dtcolumn.DefaultValue = UserInfo.Yybm; dt.Columns.Add(dtcolumn); } if (!dt.Columns.Contains("yq")) { DataColumn dtcolumn = new DataColumn("yq"); dtcolumn.DefaultValue = timer_lis; dt.Columns.Add(dtcolumn); } Form_lisBll form_lisbll = new Form_lisBll(); form_lisbll.Add(dt, "sql042"); } } catch (Exception ex) { timer_lis.Enabled = false; Jktj_lis.msgShow(ex.Message); } return(dt); }