From 4fd95d182a9aaa8b0f70ad64b09587fac7ee54fc Mon Sep 17 00:00:00 2001 From: leomon Date: Sat, 15 Apr 2023 18:22:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=AB=E9=80=9F=E5=8A=A0=E8=8D=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AIMS/AIMS.csproj | 9 + AIMS/AIMS.xml | 2 +- .../OperationAanesthesia/DrawAnasReordBill.cs | 124 +- .../frmAanesthesiaRecord.cs | 13 + AIMS/OperationAanesthesia/frmFactDrugNew.cs | 78 +- .../frmFactSpeedyDrug.Designer.cs | 795 ++++++++++ .../OperationAanesthesia/frmFactSpeedyDrug.cs | 1337 +++++++++++++++++ .../frmFactSpeedyDrug.resx | 180 +++ AIMS/OremrUserControl/ControlExtension.cs | 28 +- DrawGraph/AreaManage/AreaManageBase.cs | 4 +- DrawGraph/AreaManage/DeletePhysios.cs | 7 +- DrawGraph/AreaManage/DrugsManage.cs | 116 +- DrawGraph/AreaManage/FactDrug.cs | 18 + DrawGraph/AreaManage/MonitorManage.cs | 1 + DrawGraph/AreaManage/OperationRecord.cs | 39 +- DrawGraph/AreaManage/SapManage.cs | 82 +- DrawGraphManagement/AIMS.xml | 4 +- 17 files changed, 2630 insertions(+), 207 deletions(-) create mode 100644 AIMS/OperationAanesthesia/frmFactSpeedyDrug.Designer.cs create mode 100644 AIMS/OperationAanesthesia/frmFactSpeedyDrug.cs create mode 100644 AIMS/OperationAanesthesia/frmFactSpeedyDrug.resx diff --git a/AIMS/AIMS.csproj b/AIMS/AIMS.csproj index e8b44c4..0ae3638 100644 --- a/AIMS/AIMS.csproj +++ b/AIMS/AIMS.csproj @@ -225,6 +225,12 @@ FormLogin.cs + + Form + + + frmFactSpeedyDrug.cs + Form @@ -898,6 +904,9 @@ FormLogin.cs Designer + + frmFactSpeedyDrug.cs + frmFeesRecord.cs diff --git a/AIMS/AIMS.xml b/AIMS/AIMS.xml index a1d6e41..71c6330 100644 --- a/AIMS/AIMS.xml +++ b/AIMS/AIMS.xml @@ -1,6 +1,6 @@  - Data Source=.;Initial Catalog=AIMSDB_QHDSGRYY;User ID=sa;Password=Test2020; + Data Source=.;Initial Catalog=AIMSDB_DLSJZQZYYY;User ID=sa;Password=Test2020; Data Source=.;Initial Catalog=AIMSDB_DATA;User ID=sa;Password=Test2020; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.10.7)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl2))));Persist Security Info=True;User ID=smview;Password=i39; diff --git a/AIMS/OperationAanesthesia/DrawAnasReordBill.cs b/AIMS/OperationAanesthesia/DrawAnasReordBill.cs index 88756c0..46fcf55 100644 --- a/AIMS/OperationAanesthesia/DrawAnasReordBill.cs +++ b/AIMS/OperationAanesthesia/DrawAnasReordBill.cs @@ -11,58 +11,7 @@ using System.Windows.Forms; namespace AIMS.OperationAanesthesia { public class DrawAnasReordBill - { - public static void IniDrawAnasReordBill2(OperationRecord _record, ZedGraphControl Zgc, ref TemplateManage templateManage) - { - try - { - string jsonStr = DBHelper.ExecuteScalar("SELECT [JsonDate] FROM [dbo].[OperationRecordTemplate] where id=1").ToString(); - if (jsonStr != null && jsonStr != "") - { - templateManage = JsonConvert.DeserializeObject(jsonStr); - templateManage.OpeRecord = BOperationRecord.getRecord(_record, -1, 1); - templateManage.ZedControl = Zgc; - templateManage.Id = 1; - bool reVal = templateManage.Load(); - if (reVal) - { - templateManage.DrawArea(); - DrawGraph.ZUtil.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.018, Zgc, DrawGraph.ZUtil.Font16); - DrawGraph.ZUtil.DrawText(" 麻醉记录单", 0.4, 0.04, Zgc, DrawGraph.ZUtil.Font16); - - #region 设置界面自适应 - //在此处可随时设置板子的属性 - templateManage.ZedControl.Width = templateManage.ZedControl.Parent.Width - 54; - templateManage.ZedControl.Height = (templateManage.ZedControl.Parent.Width - 54) / 8 * 11; - - - TextPackObj janCePack = templateManage.GetPackObjectOTag("BaseInfoTopManage_TextPackObj_2"); - int LocationY = Convert.ToInt32(templateManage.ZedControl.Height * janCePack.RealY); - templateManage.LocationY = LocationY; - templateManage.SetPYL(); - templateManage.ZedControl.AxisChange(); - templateManage.ZedControl.Refresh(); - //最后还要调整图表进行自适应 - PackObjBase pack = templateManage.GetPackObjectOTag("PhysioDataManage_ChartPackObj_6"); - if (pack != null) - pack.Draw(); - #endregion - - } - else - { - MessageBox.Show(templateManage.MsgStr); - } - } - - - } - catch (Exception ex) - { - MessageBox.Show(ex.Message); - } - } - + { public static void IniDrawAnasReordBill3(OperationRecord _record, ZedGraphControl Zgc, ref TemplateManage templateManage) { try @@ -150,76 +99,7 @@ namespace AIMS.OperationAanesthesia { MessageBox.Show(ex.Message); } - } - public static void IniDrawAnasReordBill4(OperationRecord _record, ZedGraphControl Zgc, ZedGraphControl Zgc2, ref TemplateManage templateManage, ref TemplateManage templateManage2) - { - try - { - string jsonStr = DBHelper.ExecuteScalar("SELECT [JsonDate] FROM [dbo].[OperationRecordTemplate] where id=20").ToString(); - if (jsonStr != null && jsonStr != "") - { - templateManage = JsonConvert.DeserializeObject(jsonStr); - templateManage.ZedControl = Zgc; - templateManage.Id = 20; - templateManage.OpeRecord = BOperationRecord.getRecord(_record, -1, 2); - bool reVal = templateManage.Load(); - if (reVal) - { - templateManage.DrawArea(); - DrawGraph.ZUtil.DrawText(AIMSExtension.PublicMethod.GetHospitalName(), 0.385, 0.018, Zgc, DrawGraph.ZUtil.Font16); - DrawGraph.ZUtil.DrawText(" 器械清点单", 0.4, 0.04, Zgc, DrawGraph.ZUtil.Font16); - - templateManage.ZedControl.Width = templateManage.ZedControl.Parent.Width - 54; - templateManage.ZedControl.Height = (templateManage.ZedControl.Parent.Width - 54) / 8 * 11; - - TextPackObj janCePack = templateManage.GetPackObjectOTag("BaseInfoTopManage_TextPackObj_2"); - int LocationY = Convert.ToInt32(templateManage.ZedControl.Height * janCePack.RealY); - templateManage.LocationY = LocationY; - templateManage.SetPYL(); - templateManage.ZedControl.AxisChange(); - templateManage.ZedControl.Refresh(); - } - else - { - MessageBox.Show(templateManage.MsgStr); - } - } - } - catch (Exception ex) - { - MessageBox.Show(ex.Message); - } - try - { - string jsonStr = DBHelper.ExecuteScalar("SELECT [JsonDate] FROM [dbo].[OperationRecordTemplate] where id=30").ToString(); - if (jsonStr != null && jsonStr != "") - { - templateManage2 = JsonConvert.DeserializeObject(jsonStr); - templateManage2.ZedControl = Zgc2; - templateManage2.Id = 30; - templateManage2.OpeRecord = BOperationRecord.getRecord(_record, -1, 2); - bool reVal = templateManage2.Load(); - if (reVal) - { - templateManage2.DrawArea(); - templateManage2.ZedControl.Width = templateManage2.ZedControl.Parent.Width - 54; - templateManage2.ZedControl.Height = (templateManage2.ZedControl.Parent.Width - 54) / 8 * 11; - templateManage2.LocationY = 0; - templateManage2.SetPYL(); - templateManage2.ZedControl.AxisChange(); - templateManage2.ZedControl.Refresh(); - } - else - { - MessageBox.Show(templateManage2.MsgStr); - } - } - } - catch (Exception ex) - { - MessageBox.Show(ex.Message); - } - } + } public static void IniDrawAnasReordBill5(OperationRecord _record, ZedGraphControl Zgc, ZedGraphControl Zgc2, ref TemplateManage templateManage, ref TemplateManage templateManage2) { try diff --git a/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs b/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs index a683b1d..259d009 100644 --- a/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs +++ b/AIMS/OperationAanesthesia/frmAanesthesiaRecord.cs @@ -1136,6 +1136,17 @@ namespace AIMS.OperationAanesthesia } + private void _record_SpeedyDrugsParam(List factDrugs) + { + frmFactSpeedyDrug frmFact = new frmFactSpeedyDrug(); + frmFact._record = _record; + frmFact.factDrugs = factDrugs; + frmFact.zgcAnaesRecord = zgcAnaesRecord; + frmFact.DrugTypeId = RecoverId; // 事件类型 1 麻醉单事件 2 麻醉恢复单 + frmFact.DrugsParam += FrmFactDrug_DrugsParam; + frmFact.ShowDialog(); + } + private void btnOperationInfo_Click(object sender, EventArgs e) { if (PatientId != 0) @@ -1941,6 +1952,8 @@ namespace AIMS.OperationAanesthesia if (PatientId != 0) { templateManage.OpeRecord = BOperationRecord.getRecord(_record, PatientId, RecoverId); + _record.SpeedyDrugsParam -= _record_SpeedyDrugsParam; + _record.SpeedyDrugsParam += _record_SpeedyDrugsParam; templateManage2.OpeRecord = templateManage.OpeRecord; templateManage.BindOperationRecordValueAll(templateManage.OpeRecord); templateManage2.BindOperationRecordValueAll(templateManage2.OpeRecord); diff --git a/AIMS/OperationAanesthesia/frmFactDrugNew.cs b/AIMS/OperationAanesthesia/frmFactDrugNew.cs index 26f46ce..f258ad1 100644 --- a/AIMS/OperationAanesthesia/frmFactDrugNew.cs +++ b/AIMS/OperationAanesthesia/frmFactDrugNew.cs @@ -38,31 +38,7 @@ namespace AIMS.PublicUI.UI /// /// 图表控件 /// - public ZedGraphControl zgcAnaesRecord; - /// - /// 用药途径集合 - /// - public List _channelList; - /// - /// 剂量单位集合 - /// - public List _dUnitList; - /// - /// 速度单位集合 - /// - public List _VelocityUnit; - /// - /// 浓度单位集合 - /// - public List _DensityUnit; - /// - /// 加药方式集合 - /// - public List _drugEffectList; - /// - ///血型集合 - /// - public List _bloodTypeList; + public ZedGraphControl zgcAnaesRecord; /// /// 选择项编号 /// @@ -157,18 +133,21 @@ namespace AIMS.PublicUI.UI private void Initial() { - _channelList = BBasicDictionary.GetBasicDictionaryByName("用药途径").SubItem; - _channelList.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); - _drugEffectList = BBasicDictionary.GetBasicDictionaryByName("加药方式").SubItem; - _drugEffectList.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); - _dUnitList = BBasicDictionary.GetBasicDictionaryByName("给药单位").SubItem; - _dUnitList.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); - _bloodTypeList = BBasicDictionary.GetBasicDictionaryByName("血型").SubItem; - _bloodTypeList.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); - _VelocityUnit = BBasicDictionary.GetBasicDictionaryByName("速度单位").SubItem; - _VelocityUnit.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); - _DensityUnit = BBasicDictionary.GetBasicDictionaryByName("浓度单位").SubItem; - _DensityUnit.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); + if (ControlExtension._channelList == null) + { + ControlExtension._channelList = BBasicDictionary.GetBasicDictionaryByName("用药途径").SubItem; + ControlExtension._channelList.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); + ControlExtension._drugEffectList = BBasicDictionary.GetBasicDictionaryByName("加药方式").SubItem; + ControlExtension._drugEffectList.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); + ControlExtension._dUnitList = BBasicDictionary.GetBasicDictionaryByName("给药单位").SubItem; + ControlExtension._dUnitList.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); + ControlExtension._bloodTypeList = BBasicDictionary.GetBasicDictionaryByName("血型").SubItem; + ControlExtension._bloodTypeList.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); + ControlExtension._VelocityUnit = BBasicDictionary.GetBasicDictionaryByName("速度单位").SubItem; + ControlExtension._VelocityUnit.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); + ControlExtension._DensityUnit = BBasicDictionary.GetBasicDictionaryByName("浓度单位").SubItem; + ControlExtension._DensityUnit.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); + } } int page = 0; @@ -565,10 +544,16 @@ namespace AIMS.PublicUI.UI DateTime starttime = DateTime.Now; try { - if (_dataGridView.Rows[e.RowIndex].Cells[14].Value != null && _dataGridView.Rows[e.RowIndex].Cells[14].Value.ToString() != "") + if (_dataGridView.Rows[e.RowIndex].Cells[16].Value != null && _dataGridView.Rows[e.RowIndex].Cells[16].Value.ToString() != "") + { + DateTime time = DateTime.Parse(_dataGridView.Rows[e.RowIndex].Cells[16].Value.ToString()); + starttime = time; + dr.Cells[15].Value = "-->"; + } + else if (_dataGridView.Rows[e.RowIndex].Cells[14].Value != null && _dataGridView.Rows[e.RowIndex].Cells[14].Value.ToString() != "") { DateTime time = DateTime.Parse(_dataGridView.Rows[e.RowIndex].Cells[14].Value.ToString()); - starttime = new DateTime(time.Year, time.Month, time.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + starttime = time; } } catch (Exception) @@ -600,6 +585,7 @@ namespace AIMS.PublicUI.UI drc.Cells[9].Value = _dataGridView.Rows[e.RowIndex + 1].Cells[9].Value;//速度单位 drc.Cells[10].Value = _dataGridView.Rows[e.RowIndex + 1].Cells[10].Value;//剂量 drc.Cells[14].Value = starttime;//开始时间 + drc.Cells[15].Value = dr.Cells[15].Value; _dataGridView.Rows.Insert(_lineNumber, drc); } } @@ -641,27 +627,27 @@ namespace AIMS.PublicUI.UI _dataGridView.Rows[e.RowIndex].Cells[0].Value = imageList1.Images[0]; } - channelCell.DataSource = _channelList; + channelCell.DataSource = ControlExtension._channelList; channelCell.DisplayMember = "Name"; channelCell.ValueMember = "Name"; - dUnitCell.DataSource = _dUnitList; + dUnitCell.DataSource = ControlExtension._dUnitList; dUnitCell.DisplayMember = "Name"; dUnitCell.ValueMember = "Name"; - drugEffectCell.DataSource = _drugEffectList; + drugEffectCell.DataSource = ControlExtension._drugEffectList; drugEffectCell.DisplayMember = "Name"; drugEffectCell.ValueMember = "Id"; - DensityUnit.DataSource = _DensityUnit; + DensityUnit.DataSource = ControlExtension._DensityUnit; DensityUnit.DisplayMember = "Name"; DensityUnit.ValueMember = "Id"; - BloodTypeCell.DataSource = _bloodTypeList; + BloodTypeCell.DataSource = ControlExtension._bloodTypeList; BloodTypeCell.DisplayMember = "Name"; BloodTypeCell.ValueMember = "Id"; - VelocityUnit.DataSource = _VelocityUnit; + VelocityUnit.DataSource = ControlExtension._VelocityUnit; VelocityUnit.DisplayMember = "Name"; VelocityUnit.ValueMember = "Id"; } @@ -1177,7 +1163,7 @@ namespace AIMS.PublicUI.UI private void FullALLDGV() { _record.FactDrugList.Sort(new FactDrugComparer()); - foreach (BasicDictionary bd in _drugEffectList) + foreach (BasicDictionary bd in ControlExtension._drugEffectList) { if (bd.Name == "麻醉前用药") { diff --git a/AIMS/OperationAanesthesia/frmFactSpeedyDrug.Designer.cs b/AIMS/OperationAanesthesia/frmFactSpeedyDrug.Designer.cs new file mode 100644 index 0000000..d397da3 --- /dev/null +++ b/AIMS/OperationAanesthesia/frmFactSpeedyDrug.Designer.cs @@ -0,0 +1,795 @@ +namespace AIMS.PublicUI.UI +{ + partial class frmFactSpeedyDrug + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmFactSpeedyDrug)); + this.panel1 = new System.Windows.Forms.Panel(); + this.panel5 = new System.Windows.Forms.Panel(); + this.tabDrugs = new DevComponents.DotNetBar.SuperTabControl(); + this.superTabControlPanel5 = new DevComponents.DotNetBar.SuperTabControlPanel(); + this.dgvDrugsSZ = new DevComponents.DotNetBar.Controls.DataGridViewX(); + this.dataGridViewImageColumn1 = new System.Windows.Forms.DataGridViewImageColumn(); + this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewComboEditBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewComboBoxColumn1 = new System.Windows.Forms.DataGridViewComboBoxColumn(); + this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewComboBoxColumn2 = new System.Windows.Forms.DataGridViewComboBoxColumn(); + this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewComboBoxColumn3 = new System.Windows.Forms.DataGridViewComboBoxColumn(); + this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewComboBoxColumn4 = new System.Windows.Forms.DataGridViewComboBoxColumn(); + this.dataGridViewComboBoxColumn23 = new System.Windows.Forms.DataGridViewComboBoxColumn(); + this.dataGridViewComboBoxColumn24 = new System.Windows.Forms.DataGridViewComboBoxColumn(); + this.dataGridViewDateTimeInputColumn3 = new DevComponents.DotNetBar.Controls.DataGridViewDateTimeInputColumn(); + this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewDateTimeInputColumn4 = new DevComponents.DotNetBar.Controls.DataGridViewDateTimeInputColumn(); + this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewComboBoxColumn(); + this.P2 = new DevComponents.DotNetBar.SuperTabItem(); + this.superTabControlPanel1 = new DevComponents.DotNetBar.SuperTabControlPanel(); + this.superTabControlPanel2 = new DevComponents.DotNetBar.SuperTabControlPanel(); + this.panel2 = new System.Windows.Forms.Panel(); + this.btnDelete = new DevComponents.DotNetBar.ButtonX(); + this.btnSave = new DevComponents.DotNetBar.ButtonX(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.superTabItem2 = new DevComponents.DotNetBar.SuperTabItem(); + this.superTabItem3 = new DevComponents.DotNetBar.SuperTabItem(); + this.superTabItem4 = new DevComponents.DotNetBar.SuperTabItem(); + this.dgvYP = new System.Windows.Forms.DataGridView(); + this.id = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Code = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.TypeId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.TypeName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.DrugName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.HCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Norm = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.DOSEPER = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.DoseUnit = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Factroy = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Channel = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Remark = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgvDosage = new System.Windows.Forms.DataGridView(); + this.Dosage = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.imageList1 = new System.Windows.Forms.ImageList(this.components); + this.panel1.SuspendLayout(); + this.panel5.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tabDrugs)).BeginInit(); + this.tabDrugs.SuspendLayout(); + this.superTabControlPanel5.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgvDrugsSZ)).BeginInit(); + this.panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgvYP)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgvDosage)).BeginInit(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.White; + this.panel1.Controls.Add(this.panel5); + this.panel1.Controls.Add(this.panel2); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(1102, 439); + this.panel1.TabIndex = 2; + // + // panel5 + // + this.panel5.Controls.Add(this.tabDrugs); + this.panel5.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel5.Location = new System.Drawing.Point(0, 42); + this.panel5.Name = "panel5"; + this.panel5.Size = new System.Drawing.Size(1102, 397); + this.panel5.TabIndex = 2; + // + // tabDrugs + // + this.tabDrugs.BackColor = System.Drawing.Color.White; + // + // + // + // + // + // + this.tabDrugs.ControlBox.CloseBox.Name = ""; + // + // + // + this.tabDrugs.ControlBox.MenuBox.Name = ""; + this.tabDrugs.ControlBox.Name = ""; + this.tabDrugs.ControlBox.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.tabDrugs.ControlBox.MenuBox, + this.tabDrugs.ControlBox.CloseBox}); + this.tabDrugs.Controls.Add(this.superTabControlPanel5); + this.tabDrugs.Controls.Add(this.superTabControlPanel1); + this.tabDrugs.Controls.Add(this.superTabControlPanel2); + this.tabDrugs.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabDrugs.ForeColor = System.Drawing.Color.Black; + this.tabDrugs.Location = new System.Drawing.Point(0, 0); + this.tabDrugs.Name = "tabDrugs"; + this.tabDrugs.ReorderTabsEnabled = true; + this.tabDrugs.SelectedTabFont = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold); + this.tabDrugs.SelectedTabIndex = 0; + this.tabDrugs.Size = new System.Drawing.Size(1102, 397); + this.tabDrugs.TabFont = new System.Drawing.Font("微软雅黑", 10.5F); + this.tabDrugs.TabIndex = 464; + this.tabDrugs.Tabs.AddRange(new DevComponents.DotNetBar.BaseItem[] { + this.P2}); + this.tabDrugs.TabStyle = DevComponents.DotNetBar.eSuperTabStyle.Office2010BackstageBlue; + this.tabDrugs.SelectedTabChanged += new System.EventHandler(this.tabDrugs_SelectedTabChanged); + // + // superTabControlPanel5 + // + this.superTabControlPanel5.Controls.Add(this.dgvDrugsSZ); + this.superTabControlPanel5.Dock = System.Windows.Forms.DockStyle.Fill; + this.superTabControlPanel5.Location = new System.Drawing.Point(0, 31); + this.superTabControlPanel5.Name = "superTabControlPanel5"; + this.superTabControlPanel5.Size = new System.Drawing.Size(1102, 366); + this.superTabControlPanel5.TabIndex = 0; + this.superTabControlPanel5.TabItem = this.P2; + this.superTabControlPanel5.Visible = false; + // + // dgvDrugsSZ + // + this.dgvDrugsSZ.AllowUserToAddRows = false; + this.dgvDrugsSZ.AllowUserToResizeColumns = false; + this.dgvDrugsSZ.AllowUserToResizeRows = false; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.MintCream; + this.dgvDrugsSZ.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + this.dgvDrugsSZ.BackgroundColor = System.Drawing.Color.White; + this.dgvDrugsSZ.BorderStyle = System.Windows.Forms.BorderStyle.None; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgvDrugsSZ.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + this.dgvDrugsSZ.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgvDrugsSZ.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.dataGridViewImageColumn1, + this.dataGridViewTextBoxColumn1, + this.dataGridViewTextBoxColumn2, + this.dataGridViewTextBoxColumn3, + this.dataGridViewComboEditBoxColumn2, + this.dataGridViewComboBoxColumn1, + this.dataGridViewTextBoxColumn4, + this.dataGridViewComboBoxColumn2, + this.dataGridViewTextBoxColumn5, + this.dataGridViewComboBoxColumn3, + this.dataGridViewTextBoxColumn6, + this.dataGridViewComboBoxColumn4, + this.dataGridViewComboBoxColumn23, + this.dataGridViewComboBoxColumn24, + this.dataGridViewDateTimeInputColumn3, + this.dataGridViewTextBoxColumn7, + this.dataGridViewDateTimeInputColumn4, + this.dataGridViewTextBoxColumn8}); + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle4.ForeColor = System.Drawing.Color.Black; + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.Black; + dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvDrugsSZ.DefaultCellStyle = dataGridViewCellStyle4; + this.dgvDrugsSZ.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgvDrugsSZ.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; + this.dgvDrugsSZ.EnableHeadersVisualStyles = false; + this.dgvDrugsSZ.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(215)))), ((int)(((byte)(229))))); + this.dgvDrugsSZ.Location = new System.Drawing.Point(0, 0); + this.dgvDrugsSZ.Margin = new System.Windows.Forms.Padding(0); + this.dgvDrugsSZ.MultiSelect = false; + this.dgvDrugsSZ.Name = "dgvDrugsSZ"; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgvDrugsSZ.RowHeadersDefaultCellStyle = dataGridViewCellStyle5; + this.dgvDrugsSZ.RowHeadersVisible = false; + this.dgvDrugsSZ.RowTemplate.Height = 25; + this.dgvDrugsSZ.ShowCellErrors = false; + this.dgvDrugsSZ.ShowCellToolTips = false; + this.dgvDrugsSZ.Size = new System.Drawing.Size(1102, 366); + this.dgvDrugsSZ.TabIndex = 16; + this.dgvDrugsSZ.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.dgvDrugs_DataError); + // + // dataGridViewImageColumn1 + // + this.dataGridViewImageColumn1.HeaderText = " "; + this.dataGridViewImageColumn1.Image = global::AIMS.Properties.Resources.SYSCRL; + this.dataGridViewImageColumn1.Name = "dataGridViewImageColumn1"; + this.dataGridViewImageColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewImageColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; + this.dataGridViewImageColumn1.Width = 30; + // + // dataGridViewTextBoxColumn1 + // + dataGridViewCellStyle3.ForeColor = System.Drawing.Color.Red; + this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle3; + this.dataGridViewTextBoxColumn1.HeaderText = "组"; + this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; + this.dataGridViewTextBoxColumn1.Width = 30; + // + // dataGridViewTextBoxColumn2 + // + this.dataGridViewTextBoxColumn2.HeaderText = "类型"; + this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; + this.dataGridViewTextBoxColumn2.Visible = false; + this.dataGridViewTextBoxColumn2.Width = 60; + // + // dataGridViewTextBoxColumn3 + // + this.dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dataGridViewTextBoxColumn3.HeaderText = "名称"; + this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; + this.dataGridViewTextBoxColumn3.Resizable = System.Windows.Forms.DataGridViewTriState.True; + // + // dataGridViewComboEditBoxColumn2 + // + this.dataGridViewComboEditBoxColumn2.HeaderText = "备注"; + this.dataGridViewComboEditBoxColumn2.Name = "dataGridViewComboEditBoxColumn2"; + this.dataGridViewComboEditBoxColumn2.Resizable = System.Windows.Forms.DataGridViewTriState.True; + // + // dataGridViewComboBoxColumn1 + // + this.dataGridViewComboBoxColumn1.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; + this.dataGridViewComboBoxColumn1.HeaderText = "途径"; + this.dataGridViewComboBoxColumn1.Name = "dataGridViewComboBoxColumn1"; + this.dataGridViewComboBoxColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewComboBoxColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.dataGridViewComboBoxColumn1.Width = 85; + // + // dataGridViewTextBoxColumn4 + // + this.dataGridViewTextBoxColumn4.HeaderText = "浓度"; + this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4"; + this.dataGridViewTextBoxColumn4.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewTextBoxColumn4.Width = 45; + // + // dataGridViewComboBoxColumn2 + // + this.dataGridViewComboBoxColumn2.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; + this.dataGridViewComboBoxColumn2.HeaderText = "浓度单位"; + this.dataGridViewComboBoxColumn2.Name = "dataGridViewComboBoxColumn2"; + this.dataGridViewComboBoxColumn2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.dataGridViewComboBoxColumn2.Width = 75; + // + // dataGridViewTextBoxColumn5 + // + this.dataGridViewTextBoxColumn5.HeaderText = "速度"; + this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5"; + this.dataGridViewTextBoxColumn5.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewTextBoxColumn5.Width = 45; + // + // dataGridViewComboBoxColumn3 + // + this.dataGridViewComboBoxColumn3.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; + this.dataGridViewComboBoxColumn3.HeaderText = "速度单位"; + this.dataGridViewComboBoxColumn3.Name = "dataGridViewComboBoxColumn3"; + this.dataGridViewComboBoxColumn3.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewComboBoxColumn3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.dataGridViewComboBoxColumn3.Width = 85; + // + // dataGridViewTextBoxColumn6 + // + this.dataGridViewTextBoxColumn6.HeaderText = "用量"; + this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6"; + this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.dataGridViewTextBoxColumn6.Width = 60; + // + // dataGridViewComboBoxColumn4 + // + this.dataGridViewComboBoxColumn4.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; + this.dataGridViewComboBoxColumn4.HeaderText = "单位"; + this.dataGridViewComboBoxColumn4.Name = "dataGridViewComboBoxColumn4"; + this.dataGridViewComboBoxColumn4.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewComboBoxColumn4.Width = 60; + // + // dataGridViewComboBoxColumn23 + // + this.dataGridViewComboBoxColumn23.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; + this.dataGridViewComboBoxColumn23.HeaderText = "血型"; + this.dataGridViewComboBoxColumn23.Name = "dataGridViewComboBoxColumn23"; + this.dataGridViewComboBoxColumn23.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewComboBoxColumn23.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.dataGridViewComboBoxColumn23.Width = 45; + // + // dataGridViewComboBoxColumn24 + // + this.dataGridViewComboBoxColumn24.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; + this.dataGridViewComboBoxColumn24.HeaderText = "加药方式"; + this.dataGridViewComboBoxColumn24.Name = "dataGridViewComboBoxColumn24"; + this.dataGridViewComboBoxColumn24.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewComboBoxColumn24.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.dataGridViewComboBoxColumn24.Visible = false; + this.dataGridViewComboBoxColumn24.Width = 80; + // + // dataGridViewDateTimeInputColumn3 + // + this.dataGridViewDateTimeInputColumn3.AutoAdvance = true; + // + // + // + this.dataGridViewDateTimeInputColumn3.BackgroundStyle.BackColor = System.Drawing.SystemColors.Window; + this.dataGridViewDateTimeInputColumn3.BackgroundStyle.Class = "DataGridViewDateTimeBorder"; + this.dataGridViewDateTimeInputColumn3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.dataGridViewDateTimeInputColumn3.BackgroundStyle.TextColor = System.Drawing.SystemColors.WindowText; + this.dataGridViewDateTimeInputColumn3.ButtonDropDown.Visible = true; + this.dataGridViewDateTimeInputColumn3.Format = DevComponents.Editors.eDateTimePickerFormat.ShortTime; + this.dataGridViewDateTimeInputColumn3.HeaderText = "开始时间"; + this.dataGridViewDateTimeInputColumn3.InputHorizontalAlignment = DevComponents.Editors.eHorizontalAlignment.Center; + // + // + // + // + // + // + this.dataGridViewDateTimeInputColumn3.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.dataGridViewDateTimeInputColumn3.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1); + // + // + // + this.dataGridViewDateTimeInputColumn3.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.dataGridViewDateTimeInputColumn3.MonthCalendar.DisplayMonth = new System.DateTime(2018, 1, 1, 0, 0, 0, 0); + this.dataGridViewDateTimeInputColumn3.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday; + // + // + // + this.dataGridViewDateTimeInputColumn3.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.dataGridViewDateTimeInputColumn3.MonthCalendar.Visible = false; + this.dataGridViewDateTimeInputColumn3.Name = "dataGridViewDateTimeInputColumn3"; + this.dataGridViewDateTimeInputColumn3.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewDateTimeInputColumn3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.dataGridViewDateTimeInputColumn3.Width = 80; + // + // dataGridViewTextBoxColumn7 + // + this.dataGridViewTextBoxColumn7.HeaderText = "持续"; + this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7"; + this.dataGridViewTextBoxColumn7.Width = 45; + // + // dataGridViewDateTimeInputColumn4 + // + this.dataGridViewDateTimeInputColumn4.AutoAdvance = true; + // + // + // + this.dataGridViewDateTimeInputColumn4.BackgroundStyle.BackColor = System.Drawing.SystemColors.Window; + this.dataGridViewDateTimeInputColumn4.BackgroundStyle.Class = "DataGridViewDateTimeBorder"; + this.dataGridViewDateTimeInputColumn4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.dataGridViewDateTimeInputColumn4.BackgroundStyle.TextColor = System.Drawing.SystemColors.WindowText; + this.dataGridViewDateTimeInputColumn4.ButtonDropDown.Visible = true; + this.dataGridViewDateTimeInputColumn4.Format = DevComponents.Editors.eDateTimePickerFormat.ShortTime; + this.dataGridViewDateTimeInputColumn4.HeaderText = "结束时间"; + this.dataGridViewDateTimeInputColumn4.InputHorizontalAlignment = DevComponents.Editors.eHorizontalAlignment.Left; + // + // + // + // + // + // + this.dataGridViewDateTimeInputColumn4.MonthCalendar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.dataGridViewDateTimeInputColumn4.MonthCalendar.CalendarDimensions = new System.Drawing.Size(1, 1); + // + // + // + this.dataGridViewDateTimeInputColumn4.MonthCalendar.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.dataGridViewDateTimeInputColumn4.MonthCalendar.DisplayMonth = new System.DateTime(2018, 1, 1, 0, 0, 0, 0); + this.dataGridViewDateTimeInputColumn4.MonthCalendar.FirstDayOfWeek = System.DayOfWeek.Monday; + // + // + // + this.dataGridViewDateTimeInputColumn4.MonthCalendar.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; + this.dataGridViewDateTimeInputColumn4.MonthCalendar.Visible = false; + this.dataGridViewDateTimeInputColumn4.Name = "dataGridViewDateTimeInputColumn4"; + this.dataGridViewDateTimeInputColumn4.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewDateTimeInputColumn4.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.dataGridViewDateTimeInputColumn4.Width = 80; + // + // dataGridViewTextBoxColumn8 + // + this.dataGridViewTextBoxColumn8.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; + this.dataGridViewTextBoxColumn8.HeaderText = "通路"; + this.dataGridViewTextBoxColumn8.Items.AddRange(new object[] { + "", + "1", + "2", + "3", + "4"}); + this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8"; + this.dataGridViewTextBoxColumn8.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewTextBoxColumn8.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.dataGridViewTextBoxColumn8.Width = 50; + // + // P2 + // + this.P2.AttachedControl = this.superTabControlPanel5; + this.P2.GlobalItem = false; + this.P2.Name = "P2"; + this.P2.Text = "手术用药"; + // + // superTabControlPanel1 + // + this.superTabControlPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.superTabControlPanel1.Location = new System.Drawing.Point(0, 0); + this.superTabControlPanel1.Name = "superTabControlPanel1"; + this.superTabControlPanel1.Size = new System.Drawing.Size(1102, 397); + this.superTabControlPanel1.TabIndex = 0; + // + // superTabControlPanel2 + // + this.superTabControlPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.superTabControlPanel2.Location = new System.Drawing.Point(0, 0); + this.superTabControlPanel2.Name = "superTabControlPanel2"; + this.superTabControlPanel2.Size = new System.Drawing.Size(1102, 397); + this.superTabControlPanel2.TabIndex = 0; + // + // panel2 + // + this.panel2.BackColor = System.Drawing.SystemColors.Control; + this.panel2.Controls.Add(this.btnDelete); + this.panel2.Controls.Add(this.btnSave); + this.panel2.Dock = System.Windows.Forms.DockStyle.Top; + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(1102, 42); + this.panel2.TabIndex = 0; + // + // btnDelete + // + this.btnDelete.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnDelete.Location = new System.Drawing.Point(895, 9); + this.btnDelete.Name = "btnDelete"; + this.btnDelete.Size = new System.Drawing.Size(86, 30); + this.btnDelete.TabIndex = 2; + this.btnDelete.Text = "删除"; + this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click); + // + // btnSave + // + this.btnSave.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnSave.Location = new System.Drawing.Point(987, 9); + this.btnSave.Name = "btnSave"; + this.btnSave.Size = new System.Drawing.Size(86, 30); + this.btnSave.TabIndex = 1; + this.btnSave.Text = "保存"; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); + // + // superTabItem2 + // + this.superTabItem2.GlobalItem = false; + this.superTabItem2.Name = "superTabItem2"; + this.superTabItem2.Text = "superTabItem2"; + // + // superTabItem3 + // + this.superTabItem3.GlobalItem = false; + this.superTabItem3.Name = "superTabItem3"; + this.superTabItem3.Text = "superTabItem3"; + // + // superTabItem4 + // + this.superTabItem4.GlobalItem = false; + this.superTabItem4.Name = "superTabItem4"; + this.superTabItem4.Text = "superTabItem4"; + // + // dgvYP + // + this.dgvYP.AllowUserToAddRows = false; + this.dgvYP.AllowUserToDeleteRows = false; + this.dgvYP.BackgroundColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle6.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgvYP.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6; + this.dgvYP.ColumnHeadersHeight = 30; + this.dgvYP.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.id, + this.Code, + this.TypeId, + this.TypeName, + this.DrugName, + this.HCode, + this.Norm, + this.DOSEPER, + this.DoseUnit, + this.Factroy, + this.Channel, + this.Remark}); + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvYP.DefaultCellStyle = dataGridViewCellStyle7; + this.dgvYP.EnableHeadersVisualStyles = false; + this.dgvYP.Location = new System.Drawing.Point(208, 203); + this.dgvYP.Name = "dgvYP"; + this.dgvYP.ReadOnly = true; + this.dgvYP.RowHeadersVisible = false; + this.dgvYP.RowTemplate.Height = 30; + this.dgvYP.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgvYP.Size = new System.Drawing.Size(793, 210); + this.dgvYP.TabIndex = 17; + this.dgvYP.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvYP_CellClick); + this.dgvYP.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgvYP_KeyDown); + this.dgvYP.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.dgvYP_KeyPress); + this.dgvYP.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.dgvYP_PreviewKeyDown); + // + // id + // + this.id.DataPropertyName = "Id"; + this.id.HeaderText = "id"; + this.id.Name = "id"; + this.id.ReadOnly = true; + this.id.Visible = false; + // + // Code + // + this.Code.DataPropertyName = "Code"; + this.Code.HeaderText = "Code"; + this.Code.Name = "Code"; + this.Code.ReadOnly = true; + this.Code.Visible = false; + // + // TypeId + // + this.TypeId.DataPropertyName = "TypeId"; + this.TypeId.HeaderText = "TypeId"; + this.TypeId.Name = "TypeId"; + this.TypeId.ReadOnly = true; + this.TypeId.Visible = false; + // + // TypeName + // + this.TypeName.DataPropertyName = "TypeName"; + this.TypeName.HeaderText = "药品类型"; + this.TypeName.Name = "TypeName"; + this.TypeName.ReadOnly = true; + this.TypeName.Visible = false; + // + // DrugName + // + this.DrugName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.DrugName.DataPropertyName = "Name"; + this.DrugName.HeaderText = "药品名称"; + this.DrugName.Name = "DrugName"; + this.DrugName.ReadOnly = true; + // + // HCode + // + this.HCode.DataPropertyName = "HCode"; + this.HCode.HeaderText = "HCode"; + this.HCode.Name = "HCode"; + this.HCode.ReadOnly = true; + this.HCode.Visible = false; + // + // Norm + // + this.Norm.DataPropertyName = "Stand"; + this.Norm.HeaderText = "规格"; + this.Norm.Name = "Norm"; + this.Norm.ReadOnly = true; + this.Norm.Width = 210; + // + // DOSEPER + // + this.DOSEPER.DataPropertyName = "Dosage"; + this.DOSEPER.HeaderText = "剂量"; + this.DOSEPER.Name = "DOSEPER"; + this.DOSEPER.ReadOnly = true; + this.DOSEPER.Visible = false; + this.DOSEPER.Width = 60; + // + // DoseUnit + // + this.DoseUnit.DataPropertyName = "DosageUnit"; + this.DoseUnit.HeaderText = "单位"; + this.DoseUnit.Name = "DoseUnit"; + this.DoseUnit.ReadOnly = true; + this.DoseUnit.Width = 50; + // + // Factroy + // + this.Factroy.DataPropertyName = "Factory"; + this.Factroy.HeaderText = "厂家"; + this.Factroy.Name = "Factroy"; + this.Factroy.ReadOnly = true; + this.Factroy.Width = 200; + // + // Channel + // + this.Channel.DataPropertyName = "Channel"; + this.Channel.HeaderText = "途径"; + this.Channel.Name = "Channel"; + this.Channel.ReadOnly = true; + this.Channel.Visible = false; + // + // Remark + // + this.Remark.DataPropertyName = "Remark"; + this.Remark.HeaderText = "备注"; + this.Remark.Name = "Remark"; + this.Remark.ReadOnly = true; + this.Remark.Visible = false; + // + // dgvDosage + // + this.dgvDosage.AllowUserToAddRows = false; + this.dgvDosage.AllowUserToDeleteRows = false; + this.dgvDosage.BackgroundColor = System.Drawing.Color.White; + this.dgvDosage.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgvDosage.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8; + this.dgvDosage.ColumnHeadersHeight = 30; + this.dgvDosage.ColumnHeadersVisible = false; + this.dgvDosage.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.Dosage}); + this.dgvDosage.EnableHeadersVisualStyles = false; + this.dgvDosage.Location = new System.Drawing.Point(317, 148); + this.dgvDosage.Name = "dgvDosage"; + this.dgvDosage.ReadOnly = true; + this.dgvDosage.RowHeadersVisible = false; + this.dgvDosage.RowTemplate.Height = 30; + this.dgvDosage.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgvDosage.Size = new System.Drawing.Size(60, 90); + this.dgvDosage.TabIndex = 18; + this.dgvDosage.Visible = false; + this.dgvDosage.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDosage_CellClick); + this.dgvDosage.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgvDosage_KeyDown); + this.dgvDosage.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.dgvDosage_KeyPress); + this.dgvDosage.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.dgvDosage_PreviewKeyDown); + // + // Dosage + // + this.Dosage.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.Dosage.HeaderText = "剂量"; + this.Dosage.Name = "Dosage"; + this.Dosage.ReadOnly = true; + // + // imageList1 + // + this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); + this.imageList1.TransparentColor = System.Drawing.Color.Transparent; + this.imageList1.Images.SetKeyName(0, "插入列.png"); + this.imageList1.Images.SetKeyName(1, "未插入列 .png"); + // + // frmFactDrugNew2 + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoScroll = true; + this.ClientSize = new System.Drawing.Size(1102, 439); + this.Controls.Add(this.dgvDosage); + this.Controls.Add(this.dgvYP); + this.Controls.Add(this.panel1); + this.DoubleBuffered = true; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "frmFactDrugNew2"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "快速用药"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmFactDrugNew2_FormClosing); + this.Load += new System.EventHandler(this.frmFactDrugNew2_Load); + this.Scroll += new System.Windows.Forms.ScrollEventHandler(this.frmFactDrugNew2_Scroll); + this.Paint += new System.Windows.Forms.PaintEventHandler(this.frmFactDrugNew2_Paint); + this.panel1.ResumeLayout(false); + this.panel5.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.tabDrugs)).EndInit(); + this.tabDrugs.ResumeLayout(false); + this.superTabControlPanel5.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dgvDrugsSZ)).EndInit(); + this.panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dgvYP)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgvDosage)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Panel panel2; + private DevComponents.DotNetBar.ButtonX btnDelete; + private DevComponents.DotNetBar.ButtonX btnSave; + private System.Windows.Forms.Panel panel5; + private System.Windows.Forms.ToolTip toolTip1; + private DevComponents.DotNetBar.SuperTabItem superTabItem2; + private DevComponents.DotNetBar.SuperTabItem superTabItem3; + private DevComponents.DotNetBar.SuperTabItem superTabItem4; + private DevComponents.DotNetBar.SuperTabControlPanel superTabControlPanel1; + private DevComponents.DotNetBar.SuperTabControlPanel superTabControlPanel2; + private DevComponents.DotNetBar.SuperTabControlPanel superTabControlPanel5; + private DevComponents.DotNetBar.SuperTabItem P2; + public DevComponents.DotNetBar.SuperTabControl tabDrugs; + private DevComponents.DotNetBar.Controls.DataGridViewX dgvDrugsSZ; + private System.Windows.Forms.DataGridView dgvYP; + private System.Windows.Forms.DataGridView dgvDosage; + private System.Windows.Forms.DataGridViewTextBoxColumn Dosage; + private System.Windows.Forms.ImageList imageList1; + private System.Windows.Forms.DataGridViewTextBoxColumn id; + private System.Windows.Forms.DataGridViewTextBoxColumn Code; + private System.Windows.Forms.DataGridViewTextBoxColumn TypeId; + private System.Windows.Forms.DataGridViewTextBoxColumn TypeName; + private System.Windows.Forms.DataGridViewTextBoxColumn DrugName; + private System.Windows.Forms.DataGridViewTextBoxColumn HCode; + private System.Windows.Forms.DataGridViewTextBoxColumn Norm; + private System.Windows.Forms.DataGridViewTextBoxColumn DOSEPER; + private System.Windows.Forms.DataGridViewTextBoxColumn DoseUnit; + private System.Windows.Forms.DataGridViewTextBoxColumn Factroy; + private System.Windows.Forms.DataGridViewTextBoxColumn Channel; + private System.Windows.Forms.DataGridViewTextBoxColumn Remark; + private System.Windows.Forms.DataGridViewImageColumn dataGridViewImageColumn1; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewComboEditBoxColumn2; + private System.Windows.Forms.DataGridViewComboBoxColumn dataGridViewComboBoxColumn1; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4; + private System.Windows.Forms.DataGridViewComboBoxColumn dataGridViewComboBoxColumn2; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5; + private System.Windows.Forms.DataGridViewComboBoxColumn dataGridViewComboBoxColumn3; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6; + private System.Windows.Forms.DataGridViewComboBoxColumn dataGridViewComboBoxColumn4; + private System.Windows.Forms.DataGridViewComboBoxColumn dataGridViewComboBoxColumn23; + private System.Windows.Forms.DataGridViewComboBoxColumn dataGridViewComboBoxColumn24; + private DevComponents.DotNetBar.Controls.DataGridViewDateTimeInputColumn dataGridViewDateTimeInputColumn3; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7; + private DevComponents.DotNetBar.Controls.DataGridViewDateTimeInputColumn dataGridViewDateTimeInputColumn4; + private System.Windows.Forms.DataGridViewComboBoxColumn dataGridViewTextBoxColumn8; + } +} \ No newline at end of file diff --git a/AIMS/OperationAanesthesia/frmFactSpeedyDrug.cs b/AIMS/OperationAanesthesia/frmFactSpeedyDrug.cs new file mode 100644 index 0000000..fcf2b27 --- /dev/null +++ b/AIMS/OperationAanesthesia/frmFactSpeedyDrug.cs @@ -0,0 +1,1337 @@ +using AIMSBLL; +using AIMSExtension; +using AIMSModel; +using DevComponents.DotNetBar; +using DevComponents.DotNetBar.Controls; +using DrawGraph; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Windows.Forms; + +namespace AIMS.PublicUI.UI +{ + public partial class frmFactSpeedyDrug : OfficeForm + { + public static object valueTime; + public int currentTabIndex = 1; + public bool isCVhageAllSapDose = false; + public int DrugTypeId; + + #region 公共成员 + int x = 0; + /// + /// 修改加药委托 + /// + public delegate void DrugsParamHandler(); + /// + /// 修改加药事件 + /// + public event DrugsParamHandler DrugsParam; + /// + /// 手术记录 + /// + public DrawGraph.OperationRecord _record; + /// + /// 选中记录 + /// + public List factDrugs; + /// + /// 图表控件 + /// + public ZedGraphControl zgcAnaesRecord; + + /// + /// 选择项编号 + /// + public int _itemId; + public DataGridView _dataGridView; + private int _lineNumber; + + #endregion + + public frmFactSpeedyDrug() + { + InitializeComponent(); + } + + private void frmFactDrugNew2_Load(object sender, EventArgs e) + { + SetDGVNotSort(); + Initial(); + FullALLDGV(); + tabDrugs.SelectedTabIndex = currentTabIndex; + _dataGridView = dgvDrugsSZ; + dgvYP.Visible = false; + dgvYP.AutoGenerateColumns = false; + + } + + private void SetDGVNotSort() + { + for (int i = 0; i < dgvDrugsSZ.Columns.Count; i++) + { + dgvDrugsSZ.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable; + } + } + private void SetDGVEvent(DataGridView dgv) + { + dgv.CellClick -= new DataGridViewCellEventHandler(dgvDrugs_CellClick); + dgv.CellContentClick -= new DataGridViewCellEventHandler(dgvDrugs_CellContentClick); + dgv.CellValueChanged -= new DataGridViewCellEventHandler(dgvDrugs_CellValueChanged); + dgv.CurrentCellDirtyStateChanged -= new EventHandler(dgvDrugs_CurrentCellDirtyStateChanged); + dgv.EditingControlShowing -= new DataGridViewEditingControlShowingEventHandler(dgvDrugs_EditingControlShowing); + dgv.CellEndEdit -= Dgv_CellEndEdit; + dgv.RowsAdded -= new DataGridViewRowsAddedEventHandler(dgvDrugs_RowsAdded); + dgv.CellClick += new DataGridViewCellEventHandler(dgvDrugs_CellClick); + dgv.CellContentClick += new DataGridViewCellEventHandler(dgvDrugs_CellContentClick); + dgv.CellValueChanged += new DataGridViewCellEventHandler(dgvDrugs_CellValueChanged); + dgv.CurrentCellDirtyStateChanged += new EventHandler(dgvDrugs_CurrentCellDirtyStateChanged); + dgv.EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(dgvDrugs_EditingControlShowing); + dgv.CellEndEdit += Dgv_CellEndEdit; + dgv.RowsAdded += new DataGridViewRowsAddedEventHandler(dgvDrugs_RowsAdded); + + dgv.CellLeave -= new DataGridViewCellEventHandler(dgvDrugs_CellLeave); + dgv.CellLeave += new DataGridViewCellEventHandler(dgvDrugs_CellLeave); + dgv.KeyDown -= new System.Windows.Forms.KeyEventHandler(dgvDrugs_KeyDown); + dgv.KeyDown += new System.Windows.Forms.KeyEventHandler(dgvDrugs_KeyDown); + + } + + private void Dgv_CellEndEdit(object sender, DataGridViewCellEventArgs e) + { + if (e.ColumnIndex == 6) + { + _dataGridView.CurrentCell.Tag = _dataGridView.CurrentCell.EditedFormattedValue.ToString(); + } + } + + private void Initial() + { + if (ControlExtension._channelList == null) + { + ControlExtension._channelList = BBasicDictionary.GetBasicDictionaryByName("用药途径").SubItem; + ControlExtension._channelList.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); + ControlExtension._drugEffectList = BBasicDictionary.GetBasicDictionaryByName("加药方式").SubItem; + ControlExtension._drugEffectList.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); + ControlExtension._dUnitList = BBasicDictionary.GetBasicDictionaryByName("给药单位").SubItem; + ControlExtension._dUnitList.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); + ControlExtension._bloodTypeList = BBasicDictionary.GetBasicDictionaryByName("血型").SubItem; + ControlExtension._bloodTypeList.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); + ControlExtension._VelocityUnit = BBasicDictionary.GetBasicDictionaryByName("速度单位").SubItem; + ControlExtension._VelocityUnit.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); + ControlExtension._DensityUnit = BBasicDictionary.GetBasicDictionaryByName("浓度单位").SubItem; + ControlExtension._DensityUnit.Insert(0, new BasicDictionary() { Id = -1, Name = "" }); + } + } + + /// + /// 向DataGridView填充入量数据 + /// + private void FullDrugsData(List list) + { + if (list != null) + { + //添加入量 + if (list.Count > 0) + { + _dataGridView.Rows.Clear(); + foreach (FactDrug item in list) + { + if (item.ParentId > 0) continue; + SetDGV(item); + foreach (FactDrug sItem in list) + { + if (sItem.ParentId == item.Id) + { + SetDGV(sItem); + } + } + } + } + else + { + _dataGridView.Rows.Clear(); + } + } + } + public int zhuid = 0; + private void SetDGV(FactDrug item) + { + int index = _dataGridView.Rows.Add(); + _dataGridView.Rows[index].Tag = item.Id; + if (item.ParentId == 0) + { + _dataGridView.Rows[index].Cells[1].Value = "主"; + _dataGridView.Rows[index].Cells[0].Value = imageList1.Images[0]; + zhuid = _dataGridView.Rows[index].Index; + } + else + { + _dataGridView.Rows[index].Cells[1].Value = " ..."; + if (zhuid != 0) _dataGridView.Rows[index].Cells[1].Tag = zhuid; + _dataGridView.Rows[index].Cells[0].Value = imageList1.Images[1]; + } + _dataGridView.Rows[index].Cells[2].Tag = item.DrugId;//药品编号 + _dataGridView.Rows[index].Cells[2].Value = BDrugs.SelectSingle(item.DrugId).DrugKind;//药品编号 + _dataGridView.Rows[index].Cells[3].Value = item.DrugName;//药品名称 + _dataGridView.Rows[index].Cells[3].Tag = item.DrugId;//药品名称编号 + _dataGridView.Rows[index].Cells[5].Value = item.DrugChannel;//途径 + _dataGridView.Rows[index].Cells[4].Value = item.Remark;//备注 + if (item.Dosage != 0) + _dataGridView.Rows[index].Cells[10].Value = (double)item.Dosage;//剂量 + _dataGridView.Rows[index].Cells[11].Value = item.DosageUnit;//剂量单位 + if (item.BloodType != null && item.BloodType != "") + _dataGridView.Rows[index].Cells[12].Value = item.BloodType;//血型 + if (item.Density != 0) + _dataGridView.Rows[index].Cells[6].Value = (double)item.Density;//浓度 + if (item.DensityUnit != null && item.DensityUnit != "") + _dataGridView.Rows[index].Cells[7].Value = item.DensityUnit;//浓度单位 + if (item.Velocity != 0) + _dataGridView.Rows[index].Cells[8].Value = (double)item.Velocity;//速度 + if (item.VelocityUnit != null && item.VelocityUnit != "") + _dataGridView.Rows[index].Cells[9].Value = item.VelocityUnit;//速度单位 + if (Convert.ToDateTime(item.DrugBeginTime).ToString().Length > 0) + { + _dataGridView.Rows[index].Cells[14].Value = Convert.ToDateTime(item.DrugBeginTime);//开始时间 + } + if (item.IsContinue > 0) + { + _dataGridView.Rows[index].Cells[15].Value = "-->";//持续 + } + if (item.DrugEndTime.ToString("yyyy-MM-dd HH:mm") != item.DrugBeginTime.ToString("yyyy-MM-dd HH:mm")) + { + _dataGridView.Rows[index].Cells[16].Value = Convert.ToDateTime(item.DrugEndTime);//结束时间 + } + _dataGridView.Rows[index].Cells[17].Value = item.Access; + } + + private void dgvDrugs_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) + { + //if (e.ColumnIndex == 0) + //{ + // DataGridViewImageColumn dc = new DataGridViewImageColumn(true); + // dc.Image = imageList1.Images[0]; + // e.Value = dc.Image; + //} + } + + private void dgvDrugs_CellContentClick(object sender, DataGridViewCellEventArgs e) + { + try + { + + if (e.RowIndex >= 0) + { + int parentId = Convert.ToInt32(_dataGridView.CurrentRow.Tag); + if (_dataGridView.Rows[e.RowIndex].Cells[1].Value != null) + { + if (e.ColumnIndex == 0 && _dataGridView.Rows[e.RowIndex].Cells[1].Value.ToString() == "主") + { + DataGridViewRow dr = new DataGridViewRow(); + dr.CreateCells(_dataGridView); + dr.Cells[1].Value = " ..."; + //dr.Cells[1].Tag = parentId; + dr.Cells[1].Tag = _dataGridView.CurrentRow.Index; + dr.Cells[0].Value = imageList1.Images[1]; + _lineNumber = e.RowIndex + 1; + while (_dataGridView.Rows[_lineNumber].Cells[1].Value.ToString() == " ...") + { + _lineNumber++; + } + _dataGridView.Rows.Insert(_lineNumber, dr); + } + if (e.ColumnIndex == 1) + { + DataGridViewRow dr = new DataGridViewRow(); + dr.CreateCells(_dataGridView); + dr.Cells[1].Value = _dataGridView.Rows[e.RowIndex].Cells[1].Value; + if (dr.Cells[1].Value.ToString().Trim() != "...") + { + dr.Cells[0].Value = imageList1.Images[0]; + _lineNumber = _dataGridView.Rows.Count - 1;//追加药添加到最后一行 + } + else + { + dr.Cells[0].Value = imageList1.Images[1]; + _lineNumber = e.RowIndex + 1; + } + dr.Cells[4].Value = _dataGridView.Rows[e.RowIndex].Cells[4].Value; + dr.Cells[1].Tag = _dataGridView.Rows[e.RowIndex].Cells[1].Tag; + dr.Cells[2].Value = _dataGridView.Rows[e.RowIndex].Cells[2].Value; + dr.Cells[2].Tag = _dataGridView.Rows[e.RowIndex].Cells[2].Tag; + dr.Cells[3].Value = _dataGridView.Rows[e.RowIndex].Cells[3].Value;//药品名称 + dr.Cells[3].Tag = _dataGridView.Rows[e.RowIndex].Cells[3].Tag;//药品名称 + dr.Cells[5].Value = _dataGridView.Rows[e.RowIndex].Cells[5].Value;//途径 + dr.Cells[11].Value = _dataGridView.Rows[e.RowIndex].Cells[11].Value;//剂量单位 + dr.Cells[6].Value = _dataGridView.Rows[e.RowIndex].Cells[6].Value;//浓度 + dr.Cells[6].Tag = _dataGridView.Rows[e.RowIndex].Cells[6].Value;//浓度 + dr.Cells[7].Value = _dataGridView.Rows[e.RowIndex].Cells[7].Value;//浓度单位 + dr.Cells[8].Value = _dataGridView.Rows[e.RowIndex].Cells[8].Value;//速度 + dr.Cells[9].Value = _dataGridView.Rows[e.RowIndex].Cells[9].Value;//速度单位 + dr.Cells[10].Value = _dataGridView.Rows[e.RowIndex].Cells[10].Value;//剂量 + DateTime starttime = DateTime.Now; + try + { + if (_dataGridView.Rows[e.RowIndex].Cells[16].Value != null && _dataGridView.Rows[e.RowIndex].Cells[16].Value.ToString() != "") + { + DateTime time = DateTime.Parse(_dataGridView.Rows[e.RowIndex].Cells[16].Value.ToString()); + starttime = time; + dr.Cells[15].Value = "-->"; + } + else if (_dataGridView.Rows[e.RowIndex].Cells[14].Value != null && _dataGridView.Rows[e.RowIndex].Cells[14].Value.ToString() != "") + { + DateTime time = DateTime.Parse(_dataGridView.Rows[e.RowIndex].Cells[14].Value.ToString()); + starttime = time; + } + } + catch (Exception) + { + starttime = DateTime.Now; + } + dr.Cells[14].Value = starttime;//开始时间 + _dataGridView.Rows.Insert(_lineNumber, dr); + + if (_dataGridView.Rows[e.RowIndex].Cells[1].Value.ToString() != " ..." && _dataGridView.Rows[e.RowIndex + 1].Cells[1].Value.ToString() == " ...") + { + DataGridViewRow drc = new DataGridViewRow(); + drc.CreateCells(_dataGridView); + drc.Cells[1].Value = _dataGridView.Rows[e.RowIndex + 1].Cells[1].Value; + drc.Cells[0].Value = imageList1.Images[1]; + _lineNumber = _dataGridView.Rows.Count - 1;//追加药添加到最后一行 + drc.Cells[4].Value = _dataGridView.Rows[e.RowIndex + 1].Cells[4].Value; + drc.Cells[1].Tag = dr.Index; + drc.Cells[2].Value = _dataGridView.Rows[e.RowIndex + 1].Cells[2].Value; + drc.Cells[2].Tag = _dataGridView.Rows[e.RowIndex + 1].Cells[2].Tag; + drc.Cells[3].Value = _dataGridView.Rows[e.RowIndex + 1].Cells[3].Value;//药品名称 + drc.Cells[3].Tag = _dataGridView.Rows[e.RowIndex + 1].Cells[3].Tag;//药品名称 + drc.Cells[5].Value = _dataGridView.Rows[e.RowIndex + 1].Cells[5].Value;//途径 + drc.Cells[11].Value = _dataGridView.Rows[e.RowIndex + 1].Cells[11].Value;//剂量单位 + drc.Cells[6].Value = _dataGridView.Rows[e.RowIndex + 1].Cells[6].Value;//浓度 + drc.Cells[6].Tag = _dataGridView.Rows[e.RowIndex + 1].Cells[6].Tag;//浓度 + drc.Cells[7].Value = _dataGridView.Rows[e.RowIndex + 1].Cells[7].Value;//浓度单位 + drc.Cells[8].Value = _dataGridView.Rows[e.RowIndex + 1].Cells[8].Value;//速度 + drc.Cells[9].Value = _dataGridView.Rows[e.RowIndex + 1].Cells[9].Value;//速度单位 + drc.Cells[10].Value = _dataGridView.Rows[e.RowIndex + 1].Cells[10].Value;//剂量 + drc.Cells[14].Value = starttime;//开始时间 + drc.Cells[15].Value = dr.Cells[15].Value; + _dataGridView.Rows.Insert(_lineNumber, drc); + } + } + } + } + } + catch (Exception exp) + { + PublicMethod.WriteLog(exp); + } + } + + private void dgvDrugs_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e) + { + DataGridViewComboBoxCell channelCell; + DataGridViewComboBoxCell dUnitCell; + DataGridViewComboBoxCell drugEffectCell; + DataGridViewComboBoxCell BloodTypeCell; + DataGridViewComboBoxCell DensityUnit; + DataGridViewComboBoxCell VelocityUnit; + if (e == null) + { + channelCell = _dataGridView.Rows[0].Cells[5] as DataGridViewComboBoxCell;//途径 + DensityUnit = _dataGridView.Rows[0].Cells[7] as DataGridViewComboBoxCell;//浓度单位 + dUnitCell = _dataGridView.Rows[0].Cells[11] as DataGridViewComboBoxCell;//剂量单位 + drugEffectCell = _dataGridView.Rows[0].Cells[13] as DataGridViewComboBoxCell;//速度 + BloodTypeCell = _dataGridView.Rows[0].Cells[12] as DataGridViewComboBoxCell;//血型 + VelocityUnit = _dataGridView.Rows[0].Cells[9] as DataGridViewComboBoxCell;//速度单位 + _dataGridView.Rows[0].Cells[0].Value = imageList1.Images[0]; + } + else + { + channelCell = _dataGridView.Rows[e.RowIndex].Cells[5] as DataGridViewComboBoxCell;//途径 + DensityUnit = _dataGridView.Rows[e.RowIndex].Cells[7] as DataGridViewComboBoxCell;//浓度单位 + dUnitCell = _dataGridView.Rows[e.RowIndex].Cells[11] as DataGridViewComboBoxCell;//剂量单位 + drugEffectCell = _dataGridView.Rows[e.RowIndex].Cells[13] as DataGridViewComboBoxCell;//速度 + BloodTypeCell = _dataGridView.Rows[e.RowIndex].Cells[12] as DataGridViewComboBoxCell;//血型 + VelocityUnit = _dataGridView.Rows[e.RowIndex].Cells[9] as DataGridViewComboBoxCell;//速度单位 + _dataGridView.Rows[e.RowIndex].Cells[0].Value = imageList1.Images[0]; + } + + channelCell.DataSource = ControlExtension._channelList; + channelCell.DisplayMember = "Name"; + channelCell.ValueMember = "Name"; + + dUnitCell.DataSource = ControlExtension._dUnitList; + dUnitCell.DisplayMember = "Name"; + dUnitCell.ValueMember = "Name"; + + drugEffectCell.DataSource = ControlExtension._drugEffectList; + drugEffectCell.DisplayMember = "Name"; + drugEffectCell.ValueMember = "Id"; + + DensityUnit.DataSource = ControlExtension._DensityUnit; + DensityUnit.DisplayMember = "Name"; + DensityUnit.ValueMember = "Id"; + + BloodTypeCell.DataSource = ControlExtension._bloodTypeList; + BloodTypeCell.DisplayMember = "Name"; + BloodTypeCell.ValueMember = "Id"; + + VelocityUnit.DataSource = ControlExtension._VelocityUnit; + VelocityUnit.DisplayMember = "Name"; + VelocityUnit.ValueMember = "Id"; + } + + private void dgvDrugs_CellClick(object sender, DataGridViewCellEventArgs e) + { + //点击开始时间时显示时间 + if (_dataGridView.CurrentCell != null) + { + _dataGridView.BeginEdit(true); + //点击Sign列时显示持续事件标记 + if (_dataGridView.CurrentCell.ColumnIndex == 15) + { + if (_dataGridView.CurrentCell.EditedFormattedValue.ToString() == "" && _dataGridView.CurrentRow.Cells[14].EditedFormattedValue.ToString() != "") + { + _dataGridView.CurrentCell.Value = "-->"; + //SendKeys.Send("{Tab}"); + btnSave.Focus(); + } + else + { + _dataGridView.CurrentCell.Value = ""; + _dataGridView.CurrentRow.Cells[16].Value = null;//结束时间 + btnSave.Focus(); + } + } + //点击结束时间时判断是否持续事件,并显示时间 + if (_dataGridView.CurrentCell.ColumnIndex == 16) + { + if (_dataGridView.CurrentRow.Cells[15].EditedFormattedValue.ToString() != "" && _dataGridView.CurrentCell.EditedFormattedValue.ToString() == "")//持续 + { + _dataGridView.CurrentCell.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm");//默认当前时间‘ + TimeSpan tsp = DateTime.Now - _record.InRoomTime.Value; + if (tsp.TotalHours > 12) + { + DateTime begindate = new DateTime(_record.InRoomTime.Value.Year, _record.InRoomTime.Value.Month, _record.InRoomTime.Value.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + if (begindate > _record.InRoomTime.Value) + { + begindate = DateTime.Now; + } + _dataGridView.CurrentCell.Value = begindate; + } + btnSave.Focus(); + } + } + } + } + private bool ValidTimeTxt(string dgvTimeTxt, ref string message) + { + bool k = true; + if (dgvTimeTxt == "") + { + return k; + } + if (!dgvTimeTxt.Contains("-") || !dgvTimeTxt.Contains(":") || !dgvTimeTxt.Contains(" ")) + { + return false; + } + if (dgvTimeTxt.IndexOf("-") < 1 || dgvTimeTxt.IndexOf(":") < 1 || dgvTimeTxt.IndexOf(" ") < 1) + { + return false; + } + try + { + string[] ym = dgvTimeTxt.Split(' '); + string[] sym = ym[0].Split('-'); + string[] hm = ym[1].Split(':'); + int month = Convert.ToInt16(sym[0]); + int day = Convert.ToInt16(sym[1]); + int hh = Convert.ToInt16(hm[0]); + int mm = Convert.ToInt16(hm[1]); + if (month > 12 || month < 0) + { + k = false; + message = "请填写正确的月份(1-12)"; + } + if (day > 31 || day < 0) + { + k = false; + message = "请填写正确的日期(1-31)"; + } + if (hh > 23 || hh < 0) + { + k = false; + message = "请填写正确的小时(0-23)"; + } + if (mm > 59 || hh < 0) + { + k = false; + message = "请填写正确的小时(0-59)"; + } + } + catch + { + k = false; + } + return k; + } + + private void dgvDrugs_CellValueChanged(object sender, DataGridViewCellEventArgs e) + { + if (_dataGridView == null) return; + //判断如果事件名称列内容发生变化时(输入关键字),设置显示查询结果的控件的位置及内容 + if (e.ColumnIndex == 8) + { + if (_dataGridView.CurrentCell == null || _dataGridView.CurrentRow.Cells[8].EditedFormattedValue.ToString() == "") return; + if (_dataGridView.CurrentRow.Cells[9].EditedFormattedValue.ToString() == "") _dataGridView.CurrentRow.Cells[9].Value = 85; + _dataGridView.CurrentRow.Cells[11].Value = null; + } + } + /// + /// 当前单元格内容发生改变时,将改变提交 + /// + /// + /// + private void dgvDrugs_CurrentCellDirtyStateChanged(object sender, EventArgs e) + { + if (_dataGridView.IsCurrentCellDirty) + { + _dataGridView.CommitEdit(DataGridViewDataErrorContexts.Commit); + } + } + + private void btnDelete_Click(object sender, EventArgs e) + { + try + { + if (_dataGridView.CurrentRow != null) + { + string objectName = _dataGridView.CurrentRow.Cells[3].EditedFormattedValue.ToString(); + if (_dataGridView.CurrentRow.Tag != null) + { + int id = Convert.ToInt32(_dataGridView.CurrentRow.Tag); + + ///删除子药 + List ers = _record.FactDrugList.Where(b => b.ParentId == id).ToList(); + if (ers.Count > 0) + { + MessageBox.Show("请先删除子药 再进行删除!", "系统提示"); + return; + } + FactDrug er = _record.FactDrugList.Where(b => b.Id == id).ToList()[0]; + if (zgcAnaesRecord != null) + { + er.clearAddObj(zgcAnaesRecord); + er.clearIm(zgcAnaesRecord); + } + BFactDrug.Delete(er); + _record.FactDrugList.Remove(er); + _dataGridView.Rows.Remove(_dataGridView.CurrentRow); + _lineNumber = 0; + + + //FullALLDGV(); + //tabDrugs_SelectedTabChanged(null, null); + if (DrugsParam != null) DrugsParam(); + //if (_dataGridView.Rows.Count == 0 || _dataGridView.Rows[_dataGridView.Rows.Count - 1].Cells[3].Value != null) + //AddNewNullRows(); + } + else + { + if (_dataGridView.CurrentRow.Cells[3].Value != null)//药品名称 + { + _dataGridView.Rows.Remove(_dataGridView.CurrentRow); + _lineNumber = 0; + //if (_dataGridView.Rows.Count == 0 || _dataGridView.Rows[_dataGridView.Rows.Count - 1].Cells[3].Value != null) + // AddNewNullRows(); + } + } + } + } + catch (Exception ex) + { + PublicMethod.WriteLog(ex); + } + } + + private bool SaveValid(DataGridView _dataGridView, int index) + { + if (_dataGridView.Rows.Count < 1) return true; + foreach (DataGridViewRow dr in _dataGridView.Rows) + { + if (dr.Cells[3].EditedFormattedValue.ToString() != "")//药品名称 + { + if (dr.Cells[2].EditedFormattedValue.ToString() == "") + { + MessageBox.Show("保存失败!\n\r" + "输入的入量:" + dr.Cells[3].EditedFormattedValue.ToString() + "错误,请按照正确方式选择入量!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);//药品名称 + _dataGridView.CurrentCell = dr.Cells[3];//药品名称 + _dataGridView.BeginEdit(true); + dr.Cells[3].Value = "";//药品名称 + tabDrugs.SelectedTabIndex = index; + return false; + } + if (dr.Cells[5].EditedFormattedValue.ToString() == "")//途径 + { + MessageBox.Show("保存失败!\n\r" + "请输入:" + dr.Cells[2].EditedFormattedValue.ToString() + ":" + dr.Cells[3].EditedFormattedValue.ToString() + "的途径!", "系统提示");//药品名称 + _dataGridView.CurrentCell = dr.Cells[5];//途径 + _dataGridView.BeginEdit(true); + tabDrugs.SelectedTabIndex = index; + return false; + } + if (dr.Cells[12].EditedFormattedValue.ToString() == "" && dr.Cells[2].EditedFormattedValue.ToString() == "血液制品")//血型 + { + MessageBox.Show("保存失败!\n\r" + "请输入:" + dr.Cells[2].EditedFormattedValue.ToString() + ":" + dr.Cells[3].EditedFormattedValue.ToString() + "的血型!", "系统提示");//药品名称 + _dataGridView.CurrentCell = dr.Cells[12];//血型 + _dataGridView.BeginEdit(true); + tabDrugs.SelectedTabIndex = index; + return false; + } + if (dr.Cells[14].EditedFormattedValue.ToString() == "")//开始时间 + { + MessageBox.Show("保存失败!\n\r" + "请输入:" + dr.Cells[2].EditedFormattedValue.ToString() + ":" + dr.Cells[3].EditedFormattedValue.ToString() + "的开始时间!", "系统提示");//药品名称 + _dataGridView.CurrentCell = dr.Cells[14];//开始时间 + _dataGridView.BeginEdit(true); + tabDrugs.SelectedTabIndex = index; + return false; + } + else + { + DateTime DrugBeginTime = Convert.ToDateTime(dr.Cells[14].Value.ToString()); + if (DrugBeginTime > DateTime.Now.AddHours(5)) + { + MessageBox.Show("保存失败!\n\r 用药开始时间不能大于当前时间5个小时 请检查!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);//药品名称 + _dataGridView.CurrentCell = dr.Cells[14];//开始时间 + _dataGridView.BeginEdit(true); + tabDrugs.SelectedTabIndex = index; + return false; + } + } + if (dr.Cells[14].EditedFormattedValue.ToString() != "" && dr.Cells[15].EditedFormattedValue.ToString() != "" && dr.Cells[16].EditedFormattedValue.ToString() != "")//开始时间 + { + DateTime DrugBeginTime = Convert.ToDateTime(dr.Cells[14].Value.ToString()); + DateTime endTime = Convert.ToDateTime(dr.Cells[16].Value.ToString()); + if (endTime < DrugBeginTime) + { + MessageBox.Show("保存失败!\n\r" + dr.Cells[3].EditedFormattedValue.ToString() + ": 结束时间:" + dr.Cells[16].EditedFormattedValue.ToString() + " 小于开始时间:" + dr.Cells[14].EditedFormattedValue.ToString() + " 请检查!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);//药品名称 + _dataGridView.CurrentCell = dr.Cells[16];//开始时间 + _dataGridView.BeginEdit(true); + tabDrugs.SelectedTabIndex = index; + return false; + } + if (endTime > DateTime.Now.AddHours(5)) + { + MessageBox.Show("保存失败!\n\r 用药结束时间不能大于当前时间5个小时 请检查!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);//药品名称 + _dataGridView.CurrentCell = dr.Cells[16];//开始时间 + _dataGridView.BeginEdit(true); + tabDrugs.SelectedTabIndex = index; + return false; + } + } + } + } + return true; + } + private void Save(DataGridView _dataGridView, int index) + { + try + { + if (_dataGridView.Rows.Count < 1) return; + string drugEffect = string.Empty; + switch (index) + { + case 0: + drugEffect = "麻醉前用药"; + break; + case 1: + drugEffect = "术中加药"; + break; + case 2: + drugEffect = "术后镇痛药"; + break; + } + int second = 0; + foreach (DataGridViewRow dr in _dataGridView.Rows) + { + if (dr.Cells[3].Value == null || dr.Cells[3].Value.ToString() == "")//药品名称 + continue; + //实例化FactDrug对象 + FactDrug drugsR = new FactDrug(); + drugsR.PatientId = _record.PatientId.Value; + drugsR.DrugId = Convert.ToInt32(dr.Cells[3].Tag);//药品名称 + if (drugsR.DrugId == 0)//药品名称 + continue; + if (dr.Cells[1].Value.ToString() == " ..." && dr.Cells[1].Tag != null) + { + drugsR.ParentId = Convert.ToInt32(_dataGridView.Rows[int.Parse(dr.Cells[1].Tag.ToString())].Tag); + List drs = _record.FactDrugList.Where(a => a.Id == drugsR.ParentId).ToList(); + if (drs == null || drs.Count <= 0) + continue; + } + else + { + drugsR.ParentId = 0; + } + drugsR.DrugKind = dr.Cells[2].EditedFormattedValue.ToString();//药品名称 + drugsR.DrugName = dr.Cells[3].EditedFormattedValue.ToString();//药品名称 + + drugsR.DrugChannel = dr.Cells[5].EditedFormattedValue.ToString();//途径 + if (dr.Cells[10].EditedFormattedValue.ToString() != "")//剂量 + { + drugsR.Dosage = Convert.ToDecimal(dr.Cells[10].EditedFormattedValue.ToString());//剂量 + } + drugsR.DosageUnit = dr.Cells[11].EditedFormattedValue.ToString();//剂量单位 + + if (dr.Cells[6].EditedFormattedValue.ToString() != "") + { + drugsR.Density = Convert.ToDecimal(dr.Cells[6].EditedFormattedValue.ToString());//浓度 + } + else + { + drugsR.Density = 0; + } + drugsR.DensityUnit = dr.Cells[7].EditedFormattedValue.ToString();//浓度单位 + if (dr.Cells[8].EditedFormattedValue.ToString() != "") + { + drugsR.Velocity = Convert.ToDecimal(dr.Cells[8].EditedFormattedValue.ToString());//速度 + } + else + { + drugsR.Velocity = 0; + } + drugsR.VelocityUnit = dr.Cells[9].EditedFormattedValue.ToString();//速度单位 + drugsR.BloodType = dr.Cells[12].EditedFormattedValue.ToString();//血型 + drugsR.GiveDrugType = drugEffect; + if (dr.Cells[4].EditedFormattedValue.ToString() != "")//备注 + drugsR.Remark = dr.Cells[4].EditedFormattedValue.ToString(); + else + drugsR.Remark = ""; + + if (dr.Cells[14].EditedFormattedValue.ToString() != "")//开始时间 + { + drugsR.DrugBeginTime = Convert.ToDateTime(dr.Cells[14].Value.ToString()); + if (!drugsR.DrugName.Contains("氧气")) + { + second++; + drugsR.DrugBeginTime = drugsR.DrugBeginTime.AddSeconds(second); + if (second > 5) second = 1; + } + } + drugsR.IsContinue = dr.Cells[15].EditedFormattedValue.ToString() != "" ? 1 : 0;//持续 + if (drugsR.IsContinue == 1) + { + DateTime endTime = drugsR.DrugBeginTime; + if (dr.Cells[16].EditedFormattedValue.ToString() != "") endTime = Convert.ToDateTime(dr.Cells[16].Value.ToString()); + drugsR.DrugEndTime = endTime;//结束时间 + } + else + { + drugsR.DrugEndTime = drugsR.DrugBeginTime; + } + drugsR.OperatorNo = PublicMethod.OperatorNo; + drugsR.OperatorName = PublicMethod.OperatorName; + drugsR.OperateDate = DateTime.Now; + drugsR.DrugTypeId = DrugTypeId; + if (dr.Cells[17].Value != null) + drugsR.Access = dr.Cells[17].Value.ToString(); + else + drugsR.Access = ""; + + + if (dr.Tag == null) + { + drugsR.Id = BFactDrug.Insert(drugsR); + dr.Tag = drugsR.Id; + _record.FactDrugList.Add(drugsR); + } + else + { + drugsR.Id = Convert.ToInt32(dr.Tag); + //将修改的事件保存到集合 + foreach (FactDrug FactDrug in _record.FactDrugList) + { + if (FactDrug.Id == drugsR.Id && equelDrugs(FactDrug, drugsR) == false) + { + if (drugsR.ParentId == 0) drugsR.ParentId = FactDrug.ParentId; + if (zgcAnaesRecord != null) + { + FactDrug.clearAddObj(zgcAnaesRecord); + FactDrug.clearIm(zgcAnaesRecord); + } + _record.FactDrugList.Remove(FactDrug); + _record.FactDrugList.Add(drugsR); + BFactDrug.Update(drugsR); + break; + } + } + dr.Tag = drugsR.Id; + } + } + } + catch (Exception exp) + { + PublicMethod.WriteLog(exp); + } + } + public bool equelDrugs(FactDrug oldDrug, FactDrug newDrug) + { + bool b = true; + if (oldDrug.DrugName != newDrug.DrugName) b = false; + if (oldDrug.Remark != newDrug.Remark) b = false; + if (oldDrug.Dosage != newDrug.Dosage) b = false; + if (oldDrug.Velocity != newDrug.Velocity) b = false; + if (oldDrug.Density != newDrug.Density) b = false; + if (oldDrug.DosageUnit != newDrug.DosageUnit) b = false; + if (oldDrug.VelocityUnit != newDrug.VelocityUnit) b = false; + if (oldDrug.DensityUnit != newDrug.DensityUnit) b = false; + if (oldDrug.BloodType != newDrug.BloodType) b = false; + if (oldDrug.DrugChannel != newDrug.DrugChannel) b = false; + if (oldDrug.Access != newDrug.Access) b = false; + if (oldDrug.DrugBeginTime != null && newDrug.DrugBeginTime != null && oldDrug.DrugBeginTime.ToString("yyyy-MM-dd HH:mm") != newDrug.DrugBeginTime.ToString("yyyy-MM-dd HH:mm")) b = false; + if (oldDrug.IsContinue != newDrug.IsContinue) b = false; + if (oldDrug.DrugEndTime != newDrug.DrugEndTime && oldDrug.DrugEndTime.ToString("HH:mm") != newDrug.DrugEndTime.ToString("HH:mm")) b = false; + return b; + } + private void btnSave_Click(object sender, EventArgs e) + { + try + { + btnSave.Focus(); + if (SaveValid(dgvDrugsSZ, 1)) Save(dgvDrugsSZ, 1); + else return; + + new frmMessageBox().Show(); + if (DrugsParam != null) DrugsParam(); + } + catch (Exception exp) + { + PublicMethod.WriteLog(exp); + } + } + + #region DataGridView数字单元格验证 GZ + public DataGridViewTextBoxEditingControl dgvTxt = null; // 声明 一个文本 CellEdit + public DataGridViewTextBoxEditingControl dgvTxtName = null; // 声明 一个文本 CellEdit + public DataGridViewTextBoxEditingControl dgvVensity = null; // 声明 一个文本 CellEdit + public DataGridViewTextBoxEditingControl dgvDensity = null; // 声明 一个文本 CellEdit + public DataGridViewTextBoxEditingControl dgvTextYP = null; // 声明 一个文本 CellEdit + private void dgvDrugs_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) + { + //判断类型 + if (_dataGridView.CurrentCell != null && _dataGridView.CurrentCell.ColumnIndex != 6) + { + if (e.Control.GetType().Equals(typeof(DevComponents.DotNetBar.Controls.DataGridViewDateTimeInputEditingControl))) + { + ((DevComponents.DotNetBar.Controls.DataGridViewDateTimeInputEditingControl)e.Control).DateTimeSelectorVisibility = DevComponents.Editors.DateTimeAdv.eDateTimeSelectorVisibility.DateSelector; + } + else if (dgvTxt != null) + { + dgvTxt.KeyPress -= new KeyPressEventHandler(dgvTxt_KeyPress); // 绑定事件 + } + if (_dataGridView.CurrentCell.ColumnIndex == 3) + { + dgvTextYP = (DataGridViewTextBoxEditingControl)e.Control; // 得到单元格 + dgvTextYP.KeyPress -= new KeyPressEventHandler(dgvTxtName_KeyPress); // 绑定事件 + dgvTextYP.KeyPress += new KeyPressEventHandler(dgvTxtName_KeyPress); // 绑定事件 + dgvTextYP.TextChanged -= new EventHandler(dgvTextYP_TextChanged); + dgvTextYP.TextChanged += new EventHandler(dgvTextYP_TextChanged); + dgvTextYP.PreviewKeyDown -= new PreviewKeyDownEventHandler(dgvTextYP_PreviewKeyDownEvent); + dgvTextYP.PreviewKeyDown += new PreviewKeyDownEventHandler(dgvTextYP_PreviewKeyDownEvent); + } + if (_dataGridView.CurrentCell.ColumnIndex == 10) + { + dgvTxt = (DataGridViewTextBoxEditingControl)e.Control; // 得到单元格 + dgvTxt.KeyPress -= new KeyPressEventHandler(dgvTxt_KeyPress); // 绑定事件 + dgvTxt.KeyPress += new KeyPressEventHandler(dgvTxt_KeyPress); // 绑定事件 + dgvTxt.PreviewKeyDown -= new PreviewKeyDownEventHandler(dgvTxt_PreviewKeyDownEvent); + dgvTxt.PreviewKeyDown += new PreviewKeyDownEventHandler(dgvTxt_PreviewKeyDownEvent); + } + if (_dataGridView.CurrentCell.ColumnIndex == 6) + { + dgvVensity = (DataGridViewTextBoxEditingControl)e.Control; // 得到单元格 + dgvVensity.KeyPress -= new KeyPressEventHandler(dgvTxt_KeyPress); // 绑定事件 + dgvVensity.KeyPress += new KeyPressEventHandler(dgvTxt_KeyPress); // 绑定事件 + } + if (_dataGridView.CurrentCell.ColumnIndex == 8) + { + dgvDensity = (DataGridViewTextBoxEditingControl)e.Control; // 得到单元格 + dgvDensity.KeyPress -= new KeyPressEventHandler(dgvTxt_KeyPress); // 绑定事件 + dgvDensity.KeyPress += new KeyPressEventHandler(dgvTxt_KeyPress); // 绑定事件 + } + } + + } + void dgvTxtName_KeyPress(object sender, KeyPressEventArgs e) + { + if (e.KeyChar == 34 || e.KeyChar == 39 || e.KeyChar == 47 || e.KeyChar == 44 || e.KeyChar == 58 || e.KeyChar == 59 || e.KeyChar == 60 || e.KeyChar == 62 || e.KeyChar == 63 || e.KeyChar == 91 || e.KeyChar == 92 || e.KeyChar == 93 || e.KeyChar == 123 || e.KeyChar == 124 || e.KeyChar == 125) + { + e.Handled = true; + } + } + void dgvTxt_KeyPress(object sender, KeyPressEventArgs e) + { + if (e.KeyChar < 48 || e.KeyChar > 57) + { + if (e.KeyChar != 46 && e.KeyChar != 8 && e.KeyChar != 13) + { + e.Handled = true; + } + } + TextBox tb = sender as TextBox; + if (e.KeyChar == 46) + { + int n = tb.Text.LastIndexOf("."); + if (n > 0) e.Handled = true; + } + } + #endregion + + private void FullALLDGV() + { + factDrugs.Sort(new FactDrugComparer()); + _dataGridView = dgvDrugsSZ; + SetDGVEvent(_dataGridView); + FullDrugsData(factDrugs); + tabDrugs_SelectedTabChanged(null, null); + } + private void frmFactDrugNew2_Paint(object sender, PaintEventArgs e) + { + this.HorizontalScroll.Value = x; + } + + private void frmFactDrugNew2_Scroll(object sender, ScrollEventArgs e) + { + x = this.HorizontalScroll.Value; + } + private void tabDrugs_SelectedTabChanged(object sender, SuperTabStripSelectedTabChangedEventArgs e) + { + _dataGridView = dgvDrugsSZ; + _dataGridView.Columns[1].ReadOnly = true; + _dataGridView.Columns[2].ReadOnly = true; + + //20200226 增加空行 + AddNewNullRows(); + + _dataGridView.CurrentCell = _dataGridView.Rows[_dataGridView.Rows.Count - 1].Cells[3]; + _dataGridView.BeginEdit(true); + + if (dgvYP.Visible == true) + { + dgvYP.Visible = false; + } + } + + private void AddNewNullRows() + { + if (_dataGridView.Rows.Count == 0) + { + DataGridViewRow row = new DataGridViewRow(); + row.CreateCells(_dataGridView); + row.Cells[0].Value = imageList1.Images[1]; + row.Cells[1].Value = "主"; + if (tabDrugs.SelectedTab.Name == "P3") row.Cells[5].Value = "泵入"; + _dataGridView.Rows.Add(row); + } + else + { + if (_dataGridView.Rows[_dataGridView.Rows.Count - 1].Cells[3].EditedFormattedValue.ToString() != "") + { + DataGridViewRow row = new DataGridViewRow(); + row.CreateCells(_dataGridView); + row.Cells[0].Value = imageList1.Images[1]; + row.Cells[1].Value = "主"; + if (tabDrugs.SelectedTab.Name == "P3") row.Cells[5].Value = "泵入"; + _dataGridView.Rows.Add(row); + } + } + } + private void frmFactDrugNew2_FormClosing(object sender, FormClosingEventArgs e) + { + } + + private void dgvDrugs_DataError(object sender, DataGridViewDataErrorEventArgs e) + { + if (e.Exception.Message == "DataGridViewComboBoxCell 值无效。") + { + try + { + object value = _dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; + if (!((DataGridViewComboBoxCell)_dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex]).Items.Contains(value)) + { + ((DataGridViewComboBoxCell)_dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex]).Items.Add(value); + e.ThrowException = false; + } + } + catch (Exception) + { + e.ThrowException = false; + } + + } + } + + + #region 2020-2-27 优化药品输入 GZ + + /// + /// 获取DataGridView回车事件 + /// + /// + /// + private void dgvDrugs_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyData == Keys.Enter) + { + e.Handled = true; + //药品名称单元格回车时判断并填充药品信息 + if (_dataGridView.CurrentCell.ColumnIndex == 3) + { + if (_dataGridView.CurrentRow.Cells[3].EditedFormattedValue.ToString() == "") + { + return; + } + SetYPContent(null); + } + //剂量单元格回车时填写剂量并将光标移到到下一行的药品名称单元格 + else if (_dataGridView.CurrentCell.ColumnIndex == 10) + { + if (_dataGridView.CurrentRow.Cells[10].EditedFormattedValue.ToString() == "") + { + return; + } + //_dataGridView.CurrentCell.Value = dgvDosage.Rows[index].Cells[0].Value.ToString(); + index = 0; + //dgvDosage.Visible = false; + _dataGridView.CurrentCell = _dataGridView.Rows[_dataGridView.CurrentCell.RowIndex + 1].Cells[3]; + _dataGridView.BeginEdit(true); + } + } + } + /// + /// 药品名称单元格字符串改变事件(根据输入查询药品) + /// + /// + /// + void dgvTextYP_TextChanged(object sender, EventArgs e) + { + //显示并定位药品选择列表 + if (dgvYP.Visible == false) + { + dgvYP.Visible = true; + GetControlPosition(dgvYP, _dataGridView.CurrentCell); + } + //药品名称单元格为空时,隐藏选择药品列表,否则为选择药品列表加载数据 + if (dgvTextYP.Text == "") + { + dgvYP.Visible = false; + } + else + { + string str = dgvTextYP.Text.Trim(); + DataTable dt = BDrugs.GetAllDrugsByCondition(str); + dgvYP.DataSource = dt; + } + } + /// + /// 药品名称单元格按键事件(判断输入上下箭头并处理) + /// + /// + /// + void dgvTextYP_PreviewKeyDownEvent(object sender, PreviewKeyDownEventArgs e) + { + //药品名称单元格为空时,返回 + if (_dataGridView.CurrentCell.EditedFormattedValue.ToString() == "") + { + return; + } + //显示并定位选择药品列表 + if (dgvYP.Visible == false) + { + dgvYP.Visible = true; + GetControlPosition(dgvYP, _dataGridView.CurrentCell); + } + //判断按下上下键时,选择药品列表获得焦点并定位光标 + if (e.KeyCode == Keys.Up) + { + dgvYP.Focus(); + dgvYP.Rows[dgvYP.Rows.Count - 1].Selected = true; + dgvYP.CurrentCell = dgvYP.Rows[dgvYP.Rows.Count - 1].Cells[3]; + } + if (e.KeyCode == Keys.Down) + { + if (dgvYP.Rows.Count > 0) + { + dgvYP.Focus(); + dgvYP.Rows[1].Selected = true; + dgvYP.CurrentCell = dgvYP.Rows[1].Cells[3]; + } + } + } + /// + /// 判断剂量鼠标事件 + /// + /// + /// + void dgvTxt_PreviewKeyDownEvent(object sender, PreviewKeyDownEventArgs e) + { + ////常用默认剂量小于2不做操作 + } + /// + ///获取单元格的位置并显示面板 + /// + /// + /// + private void GetControlPosition(Control pnl, DataGridViewCell cell) + { + Rectangle rec = _dataGridView.GetCellDisplayRectangle(cell.ColumnIndex, cell.RowIndex, false); + if (_dataGridView.Height - rec.Y - rec.Height - pnl.Height > 0) + { + pnl.Top = rec.Y + rec.Height + panel2.Height + 40; + } + else + { + pnl.Top = rec.Y - pnl.Height + panel2.Height + 40; + } + pnl.Left = rec.X;//TabSelDrugs.Width + + pnl.Visible = true; + } + + //定位当前行索引 + int index = 0; + + /// + /// 向药品表添加数据 + /// + /// + private void SetYPContent(DataGridViewCellEventArgs e) + { + if (e != null) + { + index = e.RowIndex; + } + if (dgvYP.Rows[index].Cells["DrugName"].EditedFormattedValue.ToString() != "") + { + //dgvDosage.Rows.Clear(); + _dataGridView.CurrentRow.Cells[2].Value = dgvYP.Rows[index].Cells["TypeName"].Value.ToString(); + _dataGridView.CurrentRow.Cells[3].Tag = int.Parse(dgvYP.Rows[index].Cells["id"].Value.ToString()); + _dataGridView.CurrentRow.Cells[3].Value = dgvYP.Rows[index].Cells["DrugName"].Value.ToString();//药品名称 + + _dataGridView.CurrentRow.Cells[11].Value = dgvYP.Rows[index].Cells["DoseUnit"].Value.ToString().Trim(); ;//备注名称 + _dataGridView.CurrentRow.Cells[4].Value = dgvYP.Rows[index].Cells["Remark"].Value.ToString(); + _dataGridView.CurrentRow.Cells[5].Value = dgvYP.Rows[index].Cells["Channel"].Value.ToString(); + if (_dataGridView.CurrentRow.Cells[2].Value.ToString() == "血液制品") + { + _dataGridView.CurrentRow.Cells[12].ReadOnly = false;//血型 + } + else + { + _dataGridView.CurrentRow.Cells[12].ReadOnly = true;//血型 + } + // if (dgvYP.Rows[index].Cells["DosageUnit"].Value.ToString() != "") + //{ + // _dataGridView.CurrentRow.Cells[11].Value = BBasicDictionary.GetDrugsUntiIdByUnitName(dgvYP.Rows[index].Cells["DosageUnit"].Value.ToString().Trim()); + //} + //开始时间默认手术当天日期 + _dataGridView.CurrentRow.Cells[14].Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm");//默认当前时间‘ + TimeSpan tsp = DateTime.Now - _record.InRoomTime.Value; + if (tsp.TotalHours > 12) + { + DateTime begindate = new DateTime(_record.InRoomTime.Value.Year, _record.InRoomTime.Value.Month, _record.InRoomTime.Value.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + _dataGridView.CurrentRow.Cells[14].Value = begindate; + } + index = 0; + dgvYP.Visible = false; + AddNewNullRows(); + _dataGridView.CurrentCell = _dataGridView.CurrentRow.Cells[10]; + _dataGridView.BeginEdit(false); + } + } + /// + /// 鼠标点击选择药品列表时,向使用药品表添加数据 + /// + /// + /// + private void dgvYP_CellClick(object sender, DataGridViewCellEventArgs e) + { + if (e.RowIndex >= 0) + { + SetYPContent(e); + } + } + /// + /// 选择药品列表上点击上下键定位并移动光标 + /// + /// + /// + private void dgvYP_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Down) + { + if (dgvYP.CurrentRow.Index == dgvYP.Rows.Count - 1) + { + e.Handled = true; + dgvYP.CurrentCell = dgvYP.Rows[0].Cells[3]; + dgvYP.Rows[0].Selected = true; + } + } + if (e.KeyCode == Keys.Up) + { + if (dgvYP.CurrentRow.Index == 0) + { + e.Handled = true; + dgvYP.CurrentCell = dgvYP.Rows[dgvYP.Rows.Count - 1].Cells[3]; + dgvYP.Rows[dgvYP.Rows.Count - 1].Selected = true; + } + } + } + /// + /// 选择药品列表点击回车键向使用药品列表添加数据 + /// + /// + /// + private void dgvYP_KeyPress(object sender, KeyPressEventArgs e) + { + if (e.KeyChar.ToString() == "\r") + { + if (dgvYP.SelectedRows.Count > 0) + { + SetYPContent(null); + } + } + } + /// + /// 选择药品列表点击回车时先定位当前行的索引 + /// + /// + /// + private void dgvYP_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + index = dgvYP.CurrentRow.Index; + } + } + /// + /// 使用药品表单元格失去焦点 + /// + /// + /// + private void dgvDrugs_CellLeave(object sender, DataGridViewCellEventArgs e) + { + //药品名称失去焦点时注销药品名称单元格的事件 + if (e.ColumnIndex == 3) + { + if (dgvTextYP != null) + { + dgvTextYP.TextChanged -= new EventHandler(dgvTextYP_TextChanged); + dgvTextYP.PreviewKeyDown -= new PreviewKeyDownEventHandler(dgvTextYP_PreviewKeyDownEvent); + dgvTextYP.KeyPress -= new KeyPressEventHandler(dgvTxtName_KeyPress); + } + } + //剂量失去焦点时注销剂量单元格的事件 + if (e.ColumnIndex == 10) + { + if (dgvTxt != null) + { + dgvTxt.KeyPress -= new KeyPressEventHandler(dgvTxt_KeyPress); + dgvTxt.PreviewKeyDown -= new PreviewKeyDownEventHandler(dgvTxt_PreviewKeyDownEvent); + } + } + } + /// + /// 重写父类捕获键盘点击事件 + /// + /// + /// + /// + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + if (keyData == Keys.Enter) + { + dgvDrugs_KeyDown(_dataGridView, new KeyEventArgs(keyData)); + return true; + } + else + { + return false; + } + } + /// + /// 选择剂量列表点击鼠标时向使用药品列表填写剂量数据 + /// + /// + /// + private void dgvDosage_CellClick(object sender, DataGridViewCellEventArgs e) + { + //if (e.RowIndex >= 0) + //{ + // _dataGridView.CurrentCell.Value = dgvDosage.Rows[e.RowIndex].Cells[0].Value.ToString(); + // index = 0; + // dgvDosage.Visible = false; + //} + } + /// + /// 选择剂量列表点击上下键时移动及定位光标 + /// + /// + /// + private void dgvDosage_KeyDown(object sender, KeyEventArgs e) + { + //if (e.KeyCode == Keys.Down) + //{ + // if (dgvDosage.CurrentRow.Index == dgvDosage.Rows.Count - 1) + // { + // e.Handled = true; + // dgvDosage.CurrentCell = dgvDosage.Rows[0].Cells[0]; + // dgvDosage.Rows[0].Selected = true; + // } + //} + //if (e.KeyCode == Keys.Up) + //{ + // if (dgvDosage.CurrentRow.Index == 0) + // { + // e.Handled = true; + // dgvDosage.CurrentCell = dgvDosage.Rows[dgvDosage.Rows.Count - 1].Cells[0]; + // dgvDosage.Rows[dgvDosage.Rows.Count - 1].Selected = true; + // } + //} + } + /// + /// 选择剂量列表回车时向使用药品列表添加剂量数据 + /// + /// + /// + private void dgvDosage_KeyPress(object sender, KeyPressEventArgs e) + { + //if (e.KeyChar.ToString() == "\r") + //{ + // if (dgvDosage.SelectedRows.Count > 0) + // { + // _dataGridView.CurrentCell.Value = dgvDosage.Rows[index].Cells[0].Value.ToString(); + // index = 0; + // dgvDosage.Visible = false; + + // } + //} + } + /// + /// 选择剂量列表回车时先定位行索引 + /// + /// + /// + private void dgvDosage_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) + { + //if (e.KeyCode == Keys.Enter) + //{ + // index = dgvDosage.CurrentRow.Index; + //} + } + + + #endregion + + + } +} diff --git a/AIMS/OperationAanesthesia/frmFactSpeedyDrug.resx b/AIMS/OperationAanesthesia/frmFactSpeedyDrug.resx new file mode 100644 index 0000000..1201bf2 --- /dev/null +++ b/AIMS/OperationAanesthesia/frmFactSpeedyDrug.resx @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 132, 17 + + + True + + + True + + + True + + + 957, 91 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAi + CAAAAk1TRnQBSQFMAgEBAgEAAYgBBgGIAQYBFAEAARQBAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFQ + AwABFAMAAQEBAAEgBgABGS4AA1UBrwOAAf4DKwH8AysB/AGZAYsBQAH9AaEBkgEAAf8BkwGCAQAB/wGW + AYcBQAH9AaMBlAEAAf8BowGUAQAB/wGjAZQBAAH/AysB/ANgAej/AA0AAZMBggEAAf8DYgH2A20B9wNt + AfcDXAH4A4AB/gGXAYYBAAH/A20B9wHsAecB5AH/AewB5wHkAf8B7AHnAeQB/wNtAfcBkwGCAQAB//8A + DQABkwGCAQAB/wNnAfIB/wL9Av8C/QL/Av0C/wL9Af8BmwGLAQAB/wMrAfwB/wL9Av8C/QL/Av0C/wL+ + Af8BkwGCAQAB//8ADQABkwGCAQAB/wMrAfwBpgGVAYMB/wGmAZUBgwH/AaYBlQGDAf8BpgGVAYMB/wGV + AYQBAAH/A4AB/gGmAZUBgwH/AaYBlQGDAf8BpgGVAYMB/wGnAZUBhAH/AZMBggEAAf//AA0AAZMBggEA + Af8BkAIAAf8DXAH4A1wB+ANcAfgDYgH2AZMBggEAAf8DKwH8A1wB+ANcAfgDXAH4A00B+gGTAYIBAAH/ + /wANAAGTAYIBAAH/A2AB8wH/AfwB/QL/AfwB/QL/AfwB/QL/AfwB/QH/AZsBiwEAAf8DKwH8Af8B/AH9 + Av8B/AH9Av8B/AH9Av8C/gH/AZMBggEAAf//AA0AAZMBggEAAf8DYAHzAf4B+wH8Af8B/gH7AfwB/wH+ + AfsB/AH/Af4B+wH8Af8BmwGLAQAB/wMrAfwB/gH7AfwB/wH+AfsB/AH/Af4B+wH8Av8C/QH/AZMBggEA + Af/0AANHAYEDRwGCA0cBggNHAYIDRwGCA0cBggGJAgAB/wNNAfoDXwH7A18B+wNfAfsDXwH7AY0CAAH/ + AacBoAGQAf0DXwH7A18B+wNfAfsCqAGfAf0BkwGCAQAB//AAAwYBCANgAfMBbQFSAVEB9wNaAfUDWgH1 + A1oB9QNaAfUBgQIAAf8DAAH/AV8BXgEyAfsBXwFeATIB+wFfAV4BMgH7Al8BMgH7AYECAAH/A2AB4wNe + AdMDXgHTA14B0wNdAdEDYAHU8AADCQELA00B+gJtAVEB9wHwAaIBAAH/AfABogEAAf8B8AGiAQAB/wHw + AaIBAAH/AYcCAAH/A1wB+AHwAaIBAAH/AfABogEAAf8B8AGiAQAB/wHwAaIBAAH/AwAB/wM4AVwMAAM+ + AWoDDgES8AADCQELA00B+gNcAfgB6gGeAQAB/wHqAZ4BAAH/AeoBngEAAf8B6gGeAQAB/wGMAgAB/wNN + AfoB6gGeAQAB/wHqAZ4BAAH/AeoBngEAAf8B6gGeAQAB/wMAAf8DOAFcDAADOAFcA18B1fAAAwkBCwNN + AfoBagFoAUcB+QNqAfkDagH5A2oB+QNqAfkBhwIAAf8CbQFsAfcDagH5A2oB+QNqAfkDagH5AwAB/wM4 + AVwMAAM1AVYDRgF98AADBwEJA00B+gGDAkAB/QFqAWgBRwH5AWoBaAFHAfkBagFoAUcB+QFqAWgBRwH5 + AYECAAH/A00B+gFqAWgBRwH5AWoBaAFHAfkBagFoAUcB+QFqAWkBRgH5AYECAAH/A1kBvgNPAZkDTwGZ + A08BmQNYAbcDUQGf8AAEAgNJAYUDSQGIA0kBiANJAYgDSQGIA0kBiAGLAgAB/wGPAkAB/QOAAf4DgAH+ + A4AB/gGkAY0BQAH9AYsCAAH/AaYBmQGDAf0BqAGlAZYB/QGoAaUBlgH9AagBpQGWAf0DgAH+AZMBggEA + Af//AA0AAZMBggEAAf8DYAHzAf4B+gH7Af8B/gH6AfsB/wH+AfoB+wH/Af4B+gH7Af8BmwGLAQAB/wMr + AfwB/gH6AfsB/wH+AfoB+wH/Af4B+gH7Av8C/QH/AZMBggEAAf//AA0AAZMBggEAAf8DYAHzAf4B+wH8 + Af8B/gH7AfwB/wH+AfsB/AH/AfsB+AH5Af8BmwGLAQAB/wMrAfwB/gH7AfwB/wH+AfsB/AH/Af4B+wH8 + Av8C/QH/AZMBggEAAf//AA0AAm0BbAH3A1wB+AOAAf4DgAH+A4AB/gOAAf4BmAGHAQAB/wMrAfwB1AHN + AcIB/wHUAc0BwgH/AdQBzQHCAf8DgAH+AZMBggEAAf//AAkAAwMBBANQAZoBkgGCAQAB/wKAAXwB/gKA + AXwB/gKAAXwB/gGTAYIBAAH/AZMBggEAAf8BjgGBAQAB/wGTAYIBAAH/AZMBggEAAf8BkwGCAQAB/wKA + AXwB/gNaAb3/AAkAAwMBBAMSARcDIwEzAyMBMwMjATMDIwEzAyMBMwMjATMDIwEzAyMBMwMjATMDIwEz + AyMBMwMWAR7/AA0AAwUBBgMEAQUDBAEFAwQBBQMEBAUBBgMFAQYDBQEGAwUBBgMFAQYDBQEGAwUBBgMD + AQTwAAFCAU0BPgcAAT4DAAEoAwABUAMAARQDAAEBAQABAQUAAfAXAAP/AQAB/gEAAQ8C/wcAAf4BAAEP + Av8HAAH+AQABDwL/BwAB/gEAAQ8C/wcAAf4BAAEPAv8HAAH+AQABDwL/BwAB/gEAAQ8C/wcAAYABAAEP + Av8JAAEPAv8IAAEBAc8C/wgAAQEBzwL/CAABAQHPAv8JAAEPAv8JAAEPAv8HAAH+AQABDwL/BwAB/gEA + AQ8C/wcAAf4BAAEPAv8HAAH8AQABDwL/BwAB/AEAAQ8C/wcAAf4BAAEPAv8HAAs= + + + + 37 + + \ No newline at end of file diff --git a/AIMS/OremrUserControl/ControlExtension.cs b/AIMS/OremrUserControl/ControlExtension.cs index 2501ee4..d99705b 100644 --- a/AIMS/OremrUserControl/ControlExtension.cs +++ b/AIMS/OremrUserControl/ControlExtension.cs @@ -1,4 +1,5 @@ -using System; +using AIMSModel; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; @@ -12,6 +13,31 @@ namespace AIMS { public static class ControlExtension { + /// + /// 用药途径集合 + /// + public static List _channelList; + /// + /// 剂量单位集合 + /// + public static List _dUnitList; + /// + /// 速度单位集合 + /// + public static List _VelocityUnit; + /// + /// 浓度单位集合 + /// + public static List _DensityUnit; + /// + /// 加药方式集合 + /// + public static List _drugEffectList; + /// + ///血型集合 + /// + public static List _bloodTypeList; + const float cos30 = 0.866f; const float sin30 = 0.5f; public static void BindWaterMark(this Control ctrl, string Text) diff --git a/DrawGraph/AreaManage/AreaManageBase.cs b/DrawGraph/AreaManage/AreaManageBase.cs index e8b7bf2..d46af49 100644 --- a/DrawGraph/AreaManage/AreaManageBase.cs +++ b/DrawGraph/AreaManage/AreaManageBase.cs @@ -63,7 +63,7 @@ namespace DrawGraph private string instanceName = ""; public delegate void MouseWheelHandler(object sender, MouseEventArgs e); - public event MouseWheelHandler MouseWheelParam; + public event MouseWheelHandler MouseWheelParam; [JsonIgnore] [XmlIgnore] @@ -291,7 +291,7 @@ namespace DrawGraph //取消滚轮事件 public void numericUpDown1_MouseWheel(object sender, MouseEventArgs e) { - MouseWheelParam(sender,e); + MouseWheelParam(sender, e); } /// /// 把OperationRecord 里的数据绑定到到画板上 diff --git a/DrawGraph/AreaManage/DeletePhysios.cs b/DrawGraph/AreaManage/DeletePhysios.cs index 0c0ee83..6078216 100644 --- a/DrawGraph/AreaManage/DeletePhysios.cs +++ b/DrawGraph/AreaManage/DeletePhysios.cs @@ -1,11 +1,6 @@ -using DrawGraph; -using System; +using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; -using System.Linq; -using System.Text; using System.Windows.Forms; namespace DrawGraph diff --git a/DrawGraph/AreaManage/DrugsManage.cs b/DrawGraph/AreaManage/DrugsManage.cs index e50b758..577439d 100644 --- a/DrawGraph/AreaManage/DrugsManage.cs +++ b/DrawGraph/AreaManage/DrugsManage.cs @@ -56,10 +56,6 @@ namespace DrawGraph /// public override void MouseDown(ZedGraphControl sender, MouseEventArgs e) { - //if (e.Button == System.Windows.Forms.MouseButtons.Left) - //{ - // MessageBox.Show(this.GetType().Name + "is Click Left Button"); - //} } public override void MouseMove(ZedGraphControl sender, MouseEventArgs e) { @@ -69,6 +65,62 @@ namespace DrawGraph } public override void MouseDoubleClick(ZedGraphControl sender, MouseEventArgs e) { + if (myOpeRecord != null) + { + if (e.Button != System.Windows.Forms.MouseButtons.Left) return; + //触发可编辑区域的事件 + double y = Convert.ToDouble(Convert.ToDouble(e.Y) / Convert.ToDouble(ZedControl.Height)); + double x = Convert.ToDouble(Convert.ToDouble(e.X) / Convert.ToDouble(ZedControl.Width)); + ZedGraphControl sender1 = sender as ZedGraphControl; + + PointF mousePt = new PointF(e.X, e.Y); + GraphPane pane = sender1.MasterPane.FindChartRect(mousePt); + + bool isDrugRange = isAddDrugRange(sender, x, y); + if (isDrugRange && e.Button == System.Windows.Forms.MouseButtons.Left) + { + DateTime BeginTime = reDrugsTime(sender as ZedGraphControl, e); + List record = new List(); + double addDragRowHeight = (lines.RealEndY - lines.RealY) / RowsCount; + foreach (FactDrug dsr in myOpeRecord.FactDrugList) + { + if (dsr.isEqualRow(y, BeginTime, addDragRowHeight)) + { + record.Add(dsr); + } + } + if (record.Count > 0) + { + List records = new List(); + foreach (var fact in record) + { + if (fact.ParentId == 0) + { + records.Add(fact); + foreach (var item in myOpeRecord.FactDrugList) + { + if (item.ParentId == fact.Id) + { + records.Add(item); + } + } + } + else + { + foreach (var item in myOpeRecord.FactDrugList) + { + if (item.Id == fact.ParentId || item.ParentId == fact.ParentId) + { + records.Add(item); + } + } + } + } + if (records.Count > 0) + myOpeRecord.SpeedyDrugsMethod(records); + } + } + } } public override void KeyUp(ZedGraphControl sender, KeyEventArgs e) { @@ -200,10 +252,10 @@ namespace DrawGraph isChildEqual = true; TimeSpan tsp = temp.DrugBeginTime - addDrug1.DrugBeginTime; //清除画图对象的名称及总药 - addDrug1.clearDNAndDT(ZedControl); + //addDrug1.clearDNAndDT(ZedControl); drugsy = addDrug1.nowY; if (drugsy <= maxDrugsy) - temp.drawText(H3pack.RealX + 0.006f, drugsy); + temp.drawText2(H3pack.RealX + 0.006f, drugsy); else ListAddDrugs(DrugListstr, i, temp); foreach (FactDrug item in temp.ChildFactDrugList) @@ -215,11 +267,11 @@ namespace DrawGraph { SetDrug(item, curTimeTemp, drugsy); //清除画图对象的名称及总药 - addDrug1item.clearDNAndDT(ZedControl); - ////因为相同则取得相同对象的Y,为当前的对象的高度 + //addDrug1item.clearDNAndDT(ZedControl); + //因为相同则取得相同对象的Y,为当前的对象的高度 drugsy = addDrug1item.nowY; if (drugsy <= maxDrugsy) - item.drawText(H3pack.RealX + 0.006f, drugsy); + item.drawText2(H3pack.RealX + 0.006f, drugsy); else ListAddDrugs(DrugListstr, i, item); continue; @@ -437,6 +489,52 @@ namespace DrawGraph PublicMethod.WriteLog(ex); } } + /// + /// 返回是否进入加药范围 + /// + /// + /// + private bool isAddDrugRange(ZedGraphControl sender, double x, double y) + { + bool reValue = false; + if (y > lines.RealY && y < lines.RealEndY) + { + if (x > H3pack.RealX && x < lines.RealEndX) + { + reValue = true; + } + } + return reValue; + } + private DateTime reDrugsTime(ZedGraphControl sender, MouseEventArgs e) + { + try + { + double x, x2; + double[] y; + double[] y2; + + double yTemp = ZedControl.Height * lines.RealEndY + 80; + PointF mousePt = new PointF(e.X, float.Parse(yTemp.ToString())); + + ZedGraphControl sender1 = sender as ZedGraphControl; + GraphPane pane = sender1.MasterPane.FindChartRect(mousePt); + if (pane != null) + { + pane.ReverseTransform(mousePt, out x, out x2, out y, out y2); + XDate xd = new XDate(x); + return xd.DateTime; + } + else + { + return DateTime.Now; + } + } + catch (Exception) + { + return DateTime.Now; + } + } #endregion #region 当前区域公用事件方法 diff --git a/DrawGraph/AreaManage/FactDrug.cs b/DrawGraph/AreaManage/FactDrug.cs index 12a44d2..3831ba4 100644 --- a/DrawGraph/AreaManage/FactDrug.cs +++ b/DrawGraph/AreaManage/FactDrug.cs @@ -130,6 +130,16 @@ namespace DrawGraph return false; } } + public bool isEqualRow(double y, DateTime time, double lineHeight) + { + bool reValue = false; + if (y > nowY && y < nowY + lineHeight) + { + reValue = true; + } + return reValue; + } + /// @@ -147,6 +157,14 @@ namespace DrawGraph //写加药的左边与右信息 drawAddText(x, y); } + public void drawText2(double x, double y) + { + if (zgcAnas == null) return; + clearAddObj(zgcAnas); + //画添加药品线,底部加加药次数和备注 + this.nowY = y; + paintAdd(y); + } /// /// 画添加药品线,底部加加药次数和备注信息 diff --git a/DrawGraph/AreaManage/MonitorManage.cs b/DrawGraph/AreaManage/MonitorManage.cs index 5b44809..f0093fc 100644 --- a/DrawGraph/AreaManage/MonitorManage.cs +++ b/DrawGraph/AreaManage/MonitorManage.cs @@ -228,6 +228,7 @@ namespace DrawGraph } } + break; } } } diff --git a/DrawGraph/AreaManage/OperationRecord.cs b/DrawGraph/AreaManage/OperationRecord.cs index 64c2c35..66d29c0 100644 --- a/DrawGraph/AreaManage/OperationRecord.cs +++ b/DrawGraph/AreaManage/OperationRecord.cs @@ -29,9 +29,9 @@ namespace DrawGraph private string endemicArea; private string bed; private string contacts; - private string contactsPhone; + private string contactsPhone; private string age; - private string address ; + private string address; [ClassAttributs(Description = "HIS编号")] @@ -59,7 +59,7 @@ namespace DrawGraph public string VisitTimes { get { return visitTimes; } - set { visitTimes = value; } + set { visitTimes = value; } } [ClassAttributs(Description = "科室编号")] @@ -164,14 +164,14 @@ namespace DrawGraph { get { return contactsPhone; } set { contactsPhone = value; } - } + } [ClassAttributs(Description = "地址")] public string Address { get { return address; } - set { address = value; } - } + set { address = value; } + } //申请信息 private string patientType; @@ -486,7 +486,7 @@ namespace DrawGraph { get { return operationApplyId; } set { operationApplyId = value; } - } + } /// /// 入手术室时间 /// @@ -707,7 +707,7 @@ namespace DrawGraph /// 气管导管拔除时间 /// [ClassAttributs(Description = "气管导管拔除时间")] - public DateTime? SpileOutTime + public DateTime? SpileOutTime { get { return spileOutTime; } set { spileOutTime = value; } @@ -1076,7 +1076,7 @@ namespace DrawGraph /// /// 操作人工号 /// - [NoCreatControlAttributs] + [NoCreatControlAttributs] public string OperatorNo { get { return operatorNo; } @@ -1085,7 +1085,7 @@ namespace DrawGraph /// /// 操作人姓名 /// - [NoCreatControlAttributs] + [NoCreatControlAttributs] public string OperatorName { get { return operatorName; } @@ -1094,7 +1094,7 @@ namespace DrawGraph /// /// 操作时间 /// - [NoCreatControlAttributs] + [NoCreatControlAttributs] public DateTime? OperateDate { get { return operateDate; } @@ -1189,8 +1189,8 @@ namespace DrawGraph public List AfterDrugsListstr = new List(); public List FluidListstr = new List(); public List PunctureAndIntubatio; - public List PhysioConfigList; - public List PhysioAnesConfigList; + public List PhysioConfigList; + public List PhysioAnesConfigList; [ClassAttributs(Description = "总页数")] public int currentPage { get; set; } @@ -1205,7 +1205,7 @@ namespace DrawGraph [ClassAttributs(Description = "页开始时间")] public DateTime PageBegin; [ClassAttributs(Description = "页结束时间")] - public DateTime lastPageBegin; + public DateTime lastPageBegin; [NoCreatControlAttributs] public string InCGType; [NoCreatControlAttributs] @@ -1214,8 +1214,8 @@ namespace DrawGraph public string StateName; [NoCreatControlAttributs] public DataTable PhysioParamList; - [NoCreatControlAttributs] - public AbleEditPackObj phListPack = null; + [NoCreatControlAttributs] + public AbleEditPackObj phListPack = null; [NoCreatControlAttributs] public PhysioDataConfig SelPhysioConfig; [NoCreatControlAttributs] @@ -1228,8 +1228,15 @@ namespace DrawGraph get { return SelectedAreaObj.GetInstance(); } } + public delegate void SpeedyDrugs(List factDrugs); + public event SpeedyDrugs SpeedyDrugsParam; + public void SpeedyDrugsMethod(List factDrugs) + { + if (SpeedyDrugsParam != null) + SpeedyDrugsParam(factDrugs); + } [NoCreatControlAttributs] public List FactEventsList { diff --git a/DrawGraph/AreaManage/SapManage.cs b/DrawGraph/AreaManage/SapManage.cs index 89a17e5..c01416d 100644 --- a/DrawGraph/AreaManage/SapManage.cs +++ b/DrawGraph/AreaManage/SapManage.cs @@ -78,6 +78,84 @@ namespace DrawGraph } public override void MouseDoubleClick(ZedGraphControl sender, MouseEventArgs e) { + if (myOpeRecord != null) + { + if (e.Button != System.Windows.Forms.MouseButtons.Left) return; + //触发可编辑区域的事件 + double y = Convert.ToDouble(Convert.ToDouble(e.Y) / Convert.ToDouble(ZedControl.Height)); + double x = Convert.ToDouble(Convert.ToDouble(e.X) / Convert.ToDouble(ZedControl.Width)); + ZedGraphControl sender1 = sender as ZedGraphControl; + + PointF mousePt = new PointF(e.X, e.Y); + GraphPane pane = sender1.MasterPane.FindChartRect(mousePt); + + bool isDrugRange = isAddDrugRange(sender, x, y); + if (isDrugRange && e.Button == System.Windows.Forms.MouseButtons.Left) + { + DateTime BeginTime = reDrugsTime(sender as ZedGraphControl, e); + List record = new List(); + double addDragRowHeight = (lines.RealEndY - lines.RealY) / RowsCount; + + foreach (FactDrug dsr in myOpeRecord.FactDrugList) + { + if (dsr.isEqualRow(y, BeginTime, addDragRowHeight)) + { + record.Add(dsr); + } + } + if (record.Count > 0) + { + myOpeRecord.SpeedyDrugsMethod(record); + } + } + + } + } + /// + /// 返回是否进入加药范围 + /// + /// + /// + private bool isAddDrugRange(ZedGraphControl sender, double x, double y) + { + bool reValue = false; + if (y > lines.RealY && y < lines.RealEndY) + { + if (x > H3pack.RealX && x < lines.RealEndX) + { + reValue = true; + } + } + return reValue; + } + private DateTime reDrugsTime(ZedGraphControl sender, MouseEventArgs e) + { + try + { + double x, x2; + double[] y; + double[] y2; + + double yTemp = ZedControl.Height * lines.RealEndY + 80; + PointF mousePt = new PointF(e.X, float.Parse(yTemp.ToString())); + + ZedGraphControl sender1 = sender as ZedGraphControl; + GraphPane pane = sender1.MasterPane.FindChartRect(mousePt); + if (pane != null) + { + pane.ReverseTransform(mousePt, out x, out x2, out y, out y2); + XDate xd = new XDate(x); + return xd.DateTime; + } + else + { + return DateTime.Now; + } + } + catch (Exception) + { + return DateTime.Now; + } } public override void KeyUp(ZedGraphControl sender, KeyEventArgs e) { @@ -318,7 +396,7 @@ namespace DrawGraph } DrugListstr.Add(string.Format("({0}){1} {2} {3}{4}{5}", i + 1, (temp.DrugBeginTime == temp.DrugEndTime) ? temp.DrugBeginTime.ToShortTimeString() : temp.DrugBeginTime.ToShortTimeString() + "->" + temp.DrugEndTime.ToShortTimeString(), temp.DrugName.Trim(), dose, "", temp.DrugChannel == null ? "" : " " + temp.DrugChannel.ToString())); //DrugListstr.Append(" "); - } + } private bool isSapDrugs(FactDrug record) { bool isSap = false; @@ -330,7 +408,7 @@ namespace DrawGraph { isSap = true; } - } + } if (record.BloodType != null && record.BloodType != "") { isSap = true; diff --git a/DrawGraphManagement/AIMS.xml b/DrawGraphManagement/AIMS.xml index 4fc6ce1..a1d6e41 100644 --- a/DrawGraphManagement/AIMS.xml +++ b/DrawGraphManagement/AIMS.xml @@ -1,6 +1,6 @@  - Data Source=.;Initial Catalog=AIMSDB_FJZPTFYY;User ID=sa;Password=123456; - Data Source=.;Initial Catalog=AIMSDB_DATA;User ID=sa;Password=123456; + Data Source=.;Initial Catalog=AIMSDB_QHDSGRYY;User ID=sa;Password=Test2020; + Data Source=.;Initial Catalog=AIMSDB_DATA;User ID=sa;Password=Test2020; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.10.7)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl2))));Persist Security Info=True;User ID=smview;Password=i39;