收费记录 查询管理导出

This commit is contained in:
leomon 2023-03-17 09:48:50 +08:00
parent 64ef972779
commit 1f46522fcc
29 changed files with 1313 additions and 333 deletions

View File

@ -56,18 +56,13 @@
</Reference>
<Reference Include="Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<EmbedInteropTypes>False</EmbedInteropTypes>
<HintPath>Extensions\Microsoft.Office.Interop.Excel.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Extensions\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>..\..\AIMS演示版本\AIMS\Extensions\office.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms.DataVisualization" />
@ -238,6 +233,12 @@
<Compile Include="OperationAanesthesia\oldSystemCode\frmPrescriptionDocument.Designer.cs">
<DependentUpon>frmPrescriptionDocument.cs</DependentUpon>
</Compile>
<Compile Include="OperationAfter\frmExportConfig.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="OperationAfter\frmExportConfig.designer.cs">
<DependentUpon>frmExportConfig.cs</DependentUpon>
</Compile>
<Compile Include="OperationAfter\frmOperationManage.cs">
<SubType>Form</SubType>
</Compile>
@ -406,6 +407,7 @@
<Compile Include="OperationFront\frmPersonSchedulKeep.designer.cs">
<DependentUpon>frmPersonSchedulKeep.cs</DependentUpon>
</Compile>
<Compile Include="OremrUserControl\ExportConfig.cs" />
<Compile Include="OremrUserControl\PanelScrollHelper.cs" />
<Compile Include="OremrUserControl\PrescriptionDocument.cs">
<SubType>UserControl</SubType>
@ -865,6 +867,9 @@
<EmbeddedResource Include="OperationAanesthesia\oldSystemCode\frmPrescriptionDocument.resx">
<DependentUpon>frmPrescriptionDocument.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="OperationAfter\frmExportConfig.resx">
<DependentUpon>frmExportConfig.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="OperationAfter\frmOperationManage.resx">
<DependentUpon>frmOperationManage.cs</DependentUpon>
</EmbeddedResource>

View File

@ -79,7 +79,7 @@ namespace AIMS.PublicUI.UI
this.dgvD.Rows[index].Cells["Id"].Value = dr["Id"].ToString();
this.dgvD.Rows[index].Cells["Index"].Value = num;
num++;
this.dgvD.Rows[index].Cells["oName"].Value = dr["Name"].ToString();
this.dgvD.Rows[index].Cells["oName"].Value = dr["Name"].ToString() + " " + dr["Bill"].ToString() + " " + dr["price"].ToString();
}
}
private void cboType_SelectedIndexChanged(object sender, EventArgs e)
@ -121,7 +121,9 @@ namespace AIMS.PublicUI.UI
}
DataRow dr = pdt.NewRow();
dr["Id"] = Convert.ToInt32(dt.Rows[i]["Id"]);
dr["Name"] = dt.Rows[i]["Name"].ToString() + " " + dr["Bill"].ToString() + " " + dr["price"].ToString();
dr["Name"] = dt.Rows[i]["Name"].ToString();
dr["Bill"] = dt.Rows[i]["Bill"].ToString();
dr["price"] = dt.Rows[i]["price"].ToString();
pdt.Rows.Add(dr);
}
return pdt;
@ -193,6 +195,8 @@ namespace AIMS.PublicUI.UI
{
ydr["Id"] = Convert.ToInt32(dr["Id"]);
ydr["Name"] = dr["Name"].ToString();
ydr["Bill"] = dr["Bill"].ToString();
ydr["price"] = dr["price"].ToString();
ydt.Rows.Add(ydr);
break;
}

View File

@ -77,7 +77,7 @@
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(717, 53);
this.panel1.Size = new System.Drawing.Size(968, 53);
this.panel1.TabIndex = 13;
//
// buttonX2
@ -164,7 +164,7 @@
this.panel2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.panel2.Location = new System.Drawing.Point(0, 53);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(717, 331);
this.panel2.Size = new System.Drawing.Size(968, 469);
this.panel2.TabIndex = 14;
//
// lblPage
@ -201,7 +201,7 @@
// btnCancelAll
//
this.btnCancelAll.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnCancelAll.Location = new System.Drawing.Point(338, 195);
this.btnCancelAll.Location = new System.Drawing.Point(489, 195);
this.btnCancelAll.Margin = new System.Windows.Forms.Padding(0);
this.btnCancelAll.Name = "btnCancelAll";
this.btnCancelAll.Size = new System.Drawing.Size(39, 110);
@ -212,7 +212,7 @@
// btnSelectAll
//
this.btnSelectAll.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnSelectAll.Location = new System.Drawing.Point(338, 79);
this.btnSelectAll.Location = new System.Drawing.Point(489, 79);
this.btnSelectAll.Margin = new System.Windows.Forms.Padding(0);
this.btnSelectAll.Name = "btnSelectAll";
this.btnSelectAll.Size = new System.Drawing.Size(39, 110);
@ -223,9 +223,9 @@
// groupBox2
//
this.groupBox2.Controls.Add(this.dgvY);
this.groupBox2.Location = new System.Drawing.Point(380, 24);
this.groupBox2.Location = new System.Drawing.Point(531, 24);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(322, 293);
this.groupBox2.Size = new System.Drawing.Size(424, 429);
this.groupBox2.TabIndex = 0;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "已选";
@ -256,7 +256,7 @@
this.dgvY.RowHeadersVisible = false;
this.dgvY.RowTemplate.Height = 23;
this.dgvY.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvY.Size = new System.Drawing.Size(316, 268);
this.dgvY.Size = new System.Drawing.Size(418, 404);
this.dgvY.TabIndex = 0;
this.dgvY.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.dgvY_EditingControlShowing);
//
@ -284,9 +284,9 @@
// groupBox1
//
this.groupBox1.Controls.Add(this.dgvD);
this.groupBox1.Location = new System.Drawing.Point(12, 24);
this.groupBox1.Location = new System.Drawing.Point(15, 24);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(323, 293);
this.groupBox1.Size = new System.Drawing.Size(471, 432);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "待选";
@ -318,7 +318,7 @@
this.dgvD.RowHeadersVisible = false;
this.dgvD.RowTemplate.Height = 23;
this.dgvD.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvD.Size = new System.Drawing.Size(317, 268);
this.dgvD.Size = new System.Drawing.Size(465, 407);
this.dgvD.TabIndex = 0;
this.dgvD.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvD_CellDoubleClick);
//
@ -354,7 +354,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(717, 384);
this.ClientSize = new System.Drawing.Size(968, 522);
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
@ -395,12 +395,12 @@
private System.Windows.Forms.DataGridViewCheckBoxColumn ySelect;
private System.Windows.Forms.DataGridViewTextBoxColumn yId;
private System.Windows.Forms.DataGridViewTextBoxColumn yName;
private System.Windows.Forms.DataGridViewTextBoxColumn Id;
private System.Windows.Forms.DataGridViewTextBoxColumn Index;
private System.Windows.Forms.DataGridViewCheckBoxColumn Selectcol;
private System.Windows.Forms.DataGridViewTextBoxColumn oName;
private DevComponents.DotNetBar.ButtonX buttonX2;
private DevComponents.DotNetBar.ButtonX buttonX1;
private System.Windows.Forms.DataGridViewTextBoxColumn Id;
private System.Windows.Forms.DataGridViewTextBoxColumn Index;
private System.Windows.Forms.DataGridViewCheckBoxColumn Select;
private System.Windows.Forms.DataGridViewTextBoxColumn oName;
}
}

View File

@ -83,7 +83,7 @@ namespace AIMS.PublicUI.UI
this.dgvD.Rows[index].Cells["Id"].Value = dr["Id"].ToString();
this.dgvD.Rows[index].Cells["Index"].Value = num;
num++;
this.dgvD.Rows[index].Cells["oName"].Value = dr["Name"].ToString();
this.dgvD.Rows[index].Cells["oName"].Value = dr["Name"].ToString() +" "+ dr["Price"].ToString();
this.dgvD.Rows[index].Cells["dDOSEPER"].Value = dr["UseDose1"].ToString();
this.dgvD.Rows[index].Cells["dDOSEPER2"].Value = dr["UseDose2"].ToString();
this.dgvD.Rows[index].Cells["dDOSEPER3"].Value = dr["UseDose3"].ToString();
@ -134,6 +134,7 @@ namespace AIMS.PublicUI.UI
dr["UseDose2"] = dt.Rows[i]["UseDose2"];
dr["UseDose3"] = dt.Rows[i]["UseDose3"];
dr["Stand"] = dt.Rows[i]["Stand"];
dr["Price"] = dt.Rows[i]["Price"];
pdt.Rows.Add(dr);
}
return pdt;

View File

@ -113,7 +113,7 @@ namespace AIMS.PublicUI.UI
this.dgvD.Rows[index].Cells["Id"].Value = dr["Id"].ToString();
this.dgvD.Rows[index].Cells["Index"].Value = num;
num++;
this.dgvD.Rows[index].Cells["oName"].Value = dr["Name"].ToString();
this.dgvD.Rows[index].Cells["oName"].Value = dr["Name"].ToString() + " " + dr["Bill"].ToString(); ;
this.dgvD.Rows[index].Cells["oCode"].Value = dr["Code"].ToString();
this.dgvD.Rows[index].Cells["oxmbm"].Value = dr["Code"].ToString();
string ITEMPRICE = dr["Price"].ToString();

View File

@ -46,17 +46,21 @@
this.panel4 = new System.Windows.Forms.Panel();
this.txtUseDose3 = new AIMS.OremrUserControl.NumTextBox();
this.txtUseDose2 = new AIMS.OremrUserControl.NumTextBox();
this.txtDosage = new AIMS.OremrUserControl.NumTextBox();
this.txtUseDose1 = new AIMS.OremrUserControl.NumTextBox();
this.txtUseRate = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txtUnit = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.cboZFBL = new System.Windows.Forms.ComboBox();
this.txtChannel = new System.Windows.Forms.ComboBox();
this.label15 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.cboDosageUnit = new System.Windows.Forms.ComboBox();
this.label16 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.txtComment = new System.Windows.Forms.TextBox();
@ -79,14 +83,13 @@
this.treeView1 = new System.Windows.Forms.TreeView();
this.panel2 = new System.Windows.Forms.Panel();
this.panel6 = new System.Windows.Forms.Panel();
this.label15 = new System.Windows.Forms.Label();
this.cboZFBL = new System.Windows.Forms.ComboBox();
this.Id = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Code = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.NameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.HelpCodeColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DrugKindColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.StandColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Dosage = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.DosageUnitColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.UseDose1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.UseDose2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -207,6 +210,7 @@
//
this.panel4.Controls.Add(this.txtUseDose3);
this.panel4.Controls.Add(this.txtUseDose2);
this.panel4.Controls.Add(this.txtDosage);
this.panel4.Controls.Add(this.txtUseDose1);
this.panel4.Controls.Add(this.txtUseRate);
this.panel4.Controls.Add(this.label6);
@ -220,6 +224,7 @@
this.panel4.Controls.Add(this.label5);
this.panel4.Controls.Add(this.label8);
this.panel4.Controls.Add(this.cboDosageUnit);
this.panel4.Controls.Add(this.label16);
this.panel4.Controls.Add(this.label7);
this.panel4.Controls.Add(this.label1);
this.panel4.Controls.Add(this.txtComment);
@ -244,23 +249,30 @@
//
// txtUseDose3
//
this.txtUseDose3.Location = new System.Drawing.Point(485, 100);
this.txtUseDose3.Location = new System.Drawing.Point(541, 100);
this.txtUseDose3.Name = "txtUseDose3";
this.txtUseDose3.Size = new System.Drawing.Size(80, 23);
this.txtUseDose3.Size = new System.Drawing.Size(61, 23);
this.txtUseDose3.TabIndex = 564;
//
// txtUseDose2
//
this.txtUseDose2.Location = new System.Drawing.Point(290, 100);
this.txtUseDose2.Location = new System.Drawing.Point(396, 100);
this.txtUseDose2.Name = "txtUseDose2";
this.txtUseDose2.Size = new System.Drawing.Size(80, 23);
this.txtUseDose2.Size = new System.Drawing.Size(57, 23);
this.txtUseDose2.TabIndex = 564;
//
// txtDosage
//
this.txtDosage.Location = new System.Drawing.Point(103, 100);
this.txtDosage.Name = "txtDosage";
this.txtDosage.Size = new System.Drawing.Size(59, 23);
this.txtDosage.TabIndex = 564;
//
// txtUseDose1
//
this.txtUseDose1.Location = new System.Drawing.Point(102, 100);
this.txtUseDose1.Location = new System.Drawing.Point(243, 102);
this.txtUseDose1.Name = "txtUseDose1";
this.txtUseDose1.Size = new System.Drawing.Size(80, 23);
this.txtUseDose1.Size = new System.Drawing.Size(65, 23);
this.txtUseDose1.TabIndex = 564;
//
// txtUseRate
@ -289,7 +301,7 @@
//
// txtUnit
//
this.txtUnit.Location = new System.Drawing.Point(287, 73);
this.txtUnit.Location = new System.Drawing.Point(287, 72);
this.txtUnit.Name = "txtUnit";
this.txtUnit.Size = new System.Drawing.Size(123, 23);
this.txtUnit.TabIndex = 560;
@ -303,6 +315,26 @@
this.label2.TabIndex = 559;
this.label2.Text = "单位";
//
// cboZFBL
//
this.cboZFBL.FormattingEnabled = true;
this.cboZFBL.Items.AddRange(new object[] {
"",
"10%",
"20%",
"30%",
"40%",
"50%",
"60%",
"70%",
"80%",
"90%",
"100%"});
this.cboZFBL.Location = new System.Drawing.Point(381, 132);
this.cboZFBL.Name = "cboZFBL";
this.cboZFBL.Size = new System.Drawing.Size(64, 22);
this.cboZFBL.TabIndex = 558;
//
// txtChannel
//
this.txtChannel.FormattingEnabled = true;
@ -311,10 +343,19 @@
this.txtChannel.Size = new System.Drawing.Size(121, 22);
this.txtChannel.TabIndex = 558;
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(312, 134);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(63, 14);
this.label15.TabIndex = 557;
this.label15.Text = "自付比例";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(408, 105);
this.label9.Location = new System.Drawing.Point(462, 105);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(70, 14);
this.label9.TabIndex = 557;
@ -332,7 +373,7 @@
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(215, 105);
this.label8.Location = new System.Drawing.Point(317, 105);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(70, 14);
this.label8.TabIndex = 557;
@ -341,15 +382,24 @@
// cboDosageUnit
//
this.cboDosageUnit.FormattingEnabled = true;
this.cboDosageUnit.Location = new System.Drawing.Point(102, 72);
this.cboDosageUnit.Location = new System.Drawing.Point(102, 73);
this.cboDosageUnit.Name = "cboDosageUnit";
this.cboDosageUnit.Size = new System.Drawing.Size(121, 22);
this.cboDosageUnit.TabIndex = 558;
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(31, 105);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(63, 14);
this.label16.TabIndex = 557;
this.label16.Text = "最小剂量";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(31, 105);
this.label7.Location = new System.Drawing.Point(171, 107);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(63, 14);
this.label7.TabIndex = 557;
@ -358,7 +408,7 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(31, 78);
this.label1.Location = new System.Drawing.Point(31, 79);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(63, 14);
this.label1.TabIndex = 557;
@ -509,6 +559,7 @@
this.HelpCodeColumn,
this.DrugKindColumn,
this.StandColumn,
this.Dosage,
this.DosageUnitColumn,
this.UseDose1,
this.UseDose2,
@ -588,35 +639,6 @@
this.panel6.Size = new System.Drawing.Size(872, 47);
this.panel6.TabIndex = 9;
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(312, 134);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(63, 14);
this.label15.TabIndex = 557;
this.label15.Text = "自付比例";
//
// cboZFBL
//
this.cboZFBL.FormattingEnabled = true;
this.cboZFBL.Items.AddRange(new object[] {
"",
"10%",
"20%",
"30%",
"40%",
"50%",
"60%",
"70%",
"80%",
"90%",
"100%"});
this.cboZFBL.Location = new System.Drawing.Point(381, 132);
this.cboZFBL.Name = "cboZFBL";
this.cboZFBL.Size = new System.Drawing.Size(64, 22);
this.cboZFBL.TabIndex = 558;
//
// Id
//
this.Id.DataPropertyName = "Id";
@ -662,6 +684,13 @@
this.StandColumn.HeaderText = "规格";
this.StandColumn.Name = "StandColumn";
//
// Dosage
//
this.Dosage.DataPropertyName = "Dosage";
this.Dosage.HeaderText = "剂量";
this.Dosage.Name = "Dosage";
this.Dosage.Width = 60;
//
// DosageUnitColumn
//
this.DosageUnitColumn.DataPropertyName = "DosageUnit";
@ -812,12 +841,15 @@
private System.Windows.Forms.TextBox txtComment;
private System.Windows.Forms.ComboBox cboZFBL;
private System.Windows.Forms.Label label15;
private AIMS.OremrUserControl.NumTextBox txtDosage;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.DataGridViewTextBoxColumn Id;
private System.Windows.Forms.DataGridViewTextBoxColumn Code;
private System.Windows.Forms.DataGridViewTextBoxColumn NameColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn HelpCodeColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn DrugKindColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn StandColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn Dosage;
private System.Windows.Forms.DataGridViewTextBoxColumn DosageUnitColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn UseDose1;
private System.Windows.Forms.DataGridViewTextBoxColumn UseDose2;

View File

@ -66,6 +66,7 @@ namespace DataDictionary.UI
txtUseRate.Text = dgv.CurrentRow.Cells["UseRate"].Value.ToString();
txtRemark.Text = dgv.CurrentRow.Cells["Remark"].Value.ToString();
txtChannel.Text = dgv.CurrentRow.Cells["Channel"].Value.ToString();
txtDosage.Text = dgv.CurrentRow.Cells["Dosage"].Value.ToString();
txtUseDose1.Text = dgv.CurrentRow.Cells["UseDose1"].Value.ToString();
txtUseDose2.Text = dgv.CurrentRow.Cells["UseDose2"].Value.ToString();
txtUseDose3.Text = dgv.CurrentRow.Cells["UseDose3"].Value.ToString();
@ -105,6 +106,7 @@ namespace DataDictionary.UI
DrugsObj.HelpCode = txtHelpCode.Text.Trim();
DrugsObj.DrugKind = cboDrugKind.Text;
DrugsObj.Stand = txtStand.Text.Trim();
DrugsObj.Dosage = txtDosage.Text.Trim();
DrugsObj.DosageUnit = cboDosageUnit.Text.Trim();
DrugsObj.Unit = txtUnit.Text.Trim();
DrugsObj.Remark = txtRemark.Text.Trim();
@ -146,6 +148,7 @@ namespace DataDictionary.UI
dgv.CurrentRow.Cells["HelpCodeColumn"].Value = txtHelpCode.Text;
dgv.CurrentRow.Cells["UseRate"].Value = txtUseRate.Text;
dgv.CurrentRow.Cells["Remark"].Value = txtRemark.Text;
dgv.CurrentRow.Cells["Dosage"].Value = txtDosage.Text;
dgv.CurrentRow.Cells["UseDose1"].Value = txtUseDose1.Text;
dgv.CurrentRow.Cells["UseDose2"].Value = txtUseDose2.Text;
dgv.CurrentRow.Cells["UseDose3"].Value = txtUseDose3.Text;
@ -182,6 +185,7 @@ namespace DataDictionary.UI
dt.Rows[i]["HelpCode"].ToString(),
dt.Rows[i]["DrugKind"].ToString(),
dt.Rows[i]["Stand"].ToString(),
dt.Rows[i]["Dosage"].ToString(),
dt.Rows[i]["DosageUnit"].ToString(),
dt.Rows[i]["UseDose1"].ToString(),
dt.Rows[i]["UseDose2"].ToString(),
@ -213,5 +217,6 @@ namespace DataDictionary.UI
GetDrugsDataTable(treeView1.SelectedNode.Name);
}
}
}
}

View File

@ -138,6 +138,9 @@
<metadata name="StandColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Dosage.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="DosageUnitColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>

Binary file not shown.

View File

@ -85,7 +85,6 @@
this.spTabBM = new DevComponents.DotNetBar.SuperTabItem();
this.panel7 = new System.Windows.Forms.Panel();
this.panel21 = new System.Windows.Forms.Panel();
this.txtIndex = new DevComponents.DotNetBar.Controls.TextBoxX();
this.panel17 = new System.Windows.Forms.Panel();
this.btnNextPage = new System.Windows.Forms.Panel();
this.panel18 = new System.Windows.Forms.Panel();
@ -1061,7 +1060,6 @@
//
// panel21
//
this.panel21.Controls.Add(this.txtIndex);
this.panel21.Controls.Add(this.panel17);
this.panel21.Controls.Add(this.btnNextPage);
this.panel21.Controls.Add(this.panel18);
@ -1075,19 +1073,6 @@
this.panel21.Size = new System.Drawing.Size(354, 40);
this.panel21.TabIndex = 10;
//
// txtIndex
//
//
//
//
this.txtIndex.Border.Class = "TextBoxBorder";
this.txtIndex.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.txtIndex.Location = new System.Drawing.Point(300, 8);
this.txtIndex.Name = "txtIndex";
this.txtIndex.PreventEnterBeep = true;
this.txtIndex.Size = new System.Drawing.Size(27, 21);
this.txtIndex.TabIndex = 9;
//
// panel17
//
this.panel17.BackgroundImage = global::AIMS.Properties.Resources._末尾页;
@ -2142,6 +2127,5 @@
private System.Windows.Forms.Panel panel18;
private System.Windows.Forms.Panel btnUpPage;
private System.Windows.Forms.ToolTip toolTip1;
private DevComponents.DotNetBar.Controls.TextBoxX txtIndex;
}
}

View File

@ -533,10 +533,10 @@
// panel2
//
this.panel2.BackColor = System.Drawing.SystemColors.Control;
this.panel2.Controls.Add(this.lblDrugs);
this.panel2.Controls.Add(this.TxtOperatorName);
this.panel2.Controls.Add(this.labelX2);
this.panel2.Controls.Add(this.labelX1);
this.panel2.Controls.Add(this.lblDrugs);
this.panel2.Controls.Add(this.btnTemp);
this.panel2.Controls.Add(this.btnTypeManager);
this.panel2.Controls.Add(this.btnDelete);
@ -566,9 +566,9 @@
this.TxtOperatorName.Border.BorderTopWidth = 1;
this.TxtOperatorName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.TxtOperatorName.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.TxtOperatorName.Location = new System.Drawing.Point(84, 7);
this.TxtOperatorName.Location = new System.Drawing.Point(59, 11);
this.TxtOperatorName.Name = "TxtOperatorName";
this.TxtOperatorName.Size = new System.Drawing.Size(110, 22);
this.TxtOperatorName.Size = new System.Drawing.Size(85, 22);
this.TxtOperatorName.TabIndex = 24;
this.TxtOperatorName.DoubleClick += new System.EventHandler(this.TxtOperatorName_DoubleClick);
//
@ -578,7 +578,7 @@
//
//
this.labelX2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX2.Location = new System.Drawing.Point(29, 6);
this.labelX2.Location = new System.Drawing.Point(4, 10);
this.labelX2.Name = "labelX2";
this.labelX2.Size = new System.Drawing.Size(50, 23);
this.labelX2.TabIndex = 13;
@ -590,7 +590,7 @@
//
//
this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX1.Location = new System.Drawing.Point(213, 6);
this.labelX1.Location = new System.Drawing.Point(150, 11);
this.labelX1.Name = "labelX1";
this.labelX1.Size = new System.Drawing.Size(75, 23);
this.labelX1.TabIndex = 13;
@ -602,15 +602,15 @@
//
//
this.lblDrugs.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.lblDrugs.Location = new System.Drawing.Point(280, 6);
this.lblDrugs.Location = new System.Drawing.Point(208, 12);
this.lblDrugs.Name = "lblDrugs";
this.lblDrugs.Size = new System.Drawing.Size(394, 23);
this.lblDrugs.Size = new System.Drawing.Size(483, 23);
this.lblDrugs.TabIndex = 13;
//
// btnTemp
//
this.btnTemp.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnTemp.Location = new System.Drawing.Point(680, 6);
this.btnTemp.Location = new System.Drawing.Point(700, 6);
this.btnTemp.Name = "btnTemp";
this.btnTemp.Size = new System.Drawing.Size(88, 30);
this.btnTemp.TabIndex = 12;
@ -620,7 +620,7 @@
// btnTypeManager
//
this.btnTypeManager.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnTypeManager.Location = new System.Drawing.Point(774, 6);
this.btnTypeManager.Location = new System.Drawing.Point(794, 6);
this.btnTypeManager.Name = "btnTypeManager";
this.btnTypeManager.Size = new System.Drawing.Size(95, 30);
this.btnTypeManager.TabIndex = 12;
@ -630,7 +630,7 @@
// btnDelete
//
this.btnDelete.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnDelete.Location = new System.Drawing.Point(875, 6);
this.btnDelete.Location = new System.Drawing.Point(895, 6);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(86, 30);
this.btnDelete.TabIndex = 2;
@ -640,7 +640,7 @@
// bynPrint
//
this.bynPrint.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.bynPrint.Location = new System.Drawing.Point(1057, 6);
this.bynPrint.Location = new System.Drawing.Point(1077, 6);
this.bynPrint.Name = "bynPrint";
this.bynPrint.Size = new System.Drawing.Size(86, 30);
this.bynPrint.TabIndex = 1;
@ -650,7 +650,7 @@
// btnSave
//
this.btnSave.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnSave.Location = new System.Drawing.Point(967, 6);
this.btnSave.Location = new System.Drawing.Point(987, 6);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(86, 30);
this.btnSave.TabIndex = 1;

View File

@ -171,6 +171,7 @@ namespace AIMS.PublicUI.UI
dr.Cells[5].Value = drug.Price;
dr.Cells[6].Value = drug.Unit;
dr.Cells[7].Value = GetDrugsNum(drug);
//dr.Cells[7].Value = CalculateDrugDose(drug);
if (_dataGridView.Rows.Count != 0 && _dataGridView.Rows[_dataGridView.Rows.Count - 1].Cells[3].EditedFormattedValue.ToString() == "")
{
@ -193,27 +194,216 @@ namespace AIMS.PublicUI.UI
decimal XMSL = 1;
List<FactDrug> drugsRecords = _record.FactDrugList.Where(a => a.DrugId == drug.Id).ToList();
decimal DOSEPER = 0;
//计算实际只数
//最小剂量
if (drug.Dosage != null && drug.Dosage != "")
DOSEPER = decimal.Parse(drug.Dosage);
//总剂量计算方式
decimal dose = 0;
drugsRecords.ForEach(a =>
//最小单位
string DOSEPERUNIT = "";
if (drug.DosageUnit != null && drug.DosageUnit != "")
DOSEPERUNIT = drug.DosageUnit;
if (drug.Name == "吸入用七氟烷")
{
if (a.Dosage > 0 && drug.DosageUnit != null && a.DosageUnit.Trim() == drug.DosageUnit.Trim())
dose += a.Dosage;
});
decimal dose = 0;
foreach (var item in drugsRecords)
{
//4.手术消耗七氟烷体积=3.6×氧流量×吸入浓度×吸入时间 诱导期耗量≈8%浓度x6L/min氧流量x2min/60minx3.6=5.7ml
if (item.DrugName == "吸入用七氟烷" && item.Density > 0 && item.DensityUnit != null && item.DensityUnit != "")
{
TimeSpan timeSpan = item.DrugEndTime - item.DrugBeginTime;
decimal yndden = 0;
_record.FactDrugList.ForEach(a => { if (a.DrugName == "氧气" && a.Velocity > 0) yndden = a.Velocity; });
if (yndden > 0)
{
dose += ((decimal)3.6) * yndden * item.Density * (decimal)Math.Round(timeSpan.TotalHours, 2) + (decimal)5.3;
}
}
}
XMSL = Math.Ceiling(dose);
}
else
{
decimal dose = 0;
foreach (var item in drugsRecords)
{
//1.当使用单位等于规格单位 总量增加实际用量
if (item.Dosage > 0 && drug.DosageUnit != null && drug.DosageUnit != "")
dose += GetConvertedValue(item.Dosage, item.DosageUnit, DOSEPERUNIT);
//2.速度 速度单位不为空 计算时间总量
else if (item.Velocity > 0 && item.VelocityUnit != null && item.VelocityUnit != "")
{
TimeSpan timeSpan = item.DrugEndTime - item.DrugBeginTime;
if (item.VelocityUnit.Contains("/h"))
{
dose += GetConvertedValue(item.Velocity, item.VelocityUnit, DOSEPERUNIT) * (decimal)Math.Round(timeSpan.TotalHours, 2);
}
else if (item.VelocityUnit.Contains("/min"))
{
dose += GetConvertedValue(item.Velocity, item.VelocityUnit, DOSEPERUNIT) * (decimal)Math.Round(timeSpan.TotalMinutes, 2);
}
}
}
//总剂量计算方式 根据规格单位得到换算完的总量 除以最小剂量
XMSL = Math.Ceiling(dose / DOSEPER);
if (XMSL < 1) XMSL = 1;
}
return XMSL;
}
decimal GetConvertedValue(decimal drugValue, string drugUnit, string ConUnit)
{
decimal value = 0;
if (drugUnit == ConUnit)
{
value = drugValue;
}
else if (drugUnit == "g" && ConUnit == "mg")
{
value = drugValue * 1000;
}
else if (drugUnit == "mg" && ConUnit == "g")
{
value = drugValue / 1000;
}
else if (drugUnit == "mg" && ConUnit == "ug")
{
value = drugValue * 1000;
}
else if (drugUnit == "ug" && ConUnit == "mg")
{
value = drugValue / 1000;
}
else if (drugUnit == "ml" && ConUnit == "l")
{
value = drugValue / 1000;
}
else if (drugUnit == "l" && ConUnit == "ml")
{
value = drugValue * 1000;
}
else if ((drugUnit == "g/h" || drugUnit == "g/min") && ConUnit == "g")
{
value = drugValue;
}
else if ((drugUnit == "mg/h" || drugUnit == "mg/min") && ConUnit == "mg")
{
value = drugValue;
}
else if ((drugUnit == "ug/h" || drugUnit == "ug/min") && ConUnit == "ug")
{
value = drugValue;
}
else if ((drugUnit == "ml/h" || drugUnit == "ml/min") && ConUnit == "ug")
{
value = drugValue;
}
else if ((drugUnit == "g/h" || drugUnit == "g/min") && ConUnit == "mg")
{
value = drugValue * 1000;
}
else if ((drugUnit == "mg/h" || drugUnit == "mg/min") && ConUnit == "g")
{
value = drugValue / 1000;
}
else if ((drugUnit == "mg/h" || drugUnit == "mg/min") && ConUnit == "ug")
{
value = drugValue * 1000;
}
else if ((drugUnit == "ug/h" || drugUnit == "ug/min") && ConUnit == "mg")
{
value = drugValue / 1000;
}
return value;
}
decimal CalculateDrugDose(Drugs drug)
{
decimal dosePer = 0;
if (decimal.TryParse(drug.Dosage, out decimal parsedDosePer))
{
dosePer = parsedDosePer;
}
string dosePerUnit = string.IsNullOrEmpty(drug.DosageUnit) ? "" : drug.DosageUnit;
List<FactDrug> drugsRecords = _record.FactDrugList.Where(a => a.DrugId == drug.Id).ToList();
switch (drug.Name)
{
case "吸入用七氟烷":
decimal dose = 0;
foreach (var item in drugsRecords.Where(item => item.DrugName == "吸入用七氟烷" && item.Density > 0 && !string.IsNullOrEmpty(item.DensityUnit)))
{
TimeSpan timeSpan = item.DrugEndTime - item.DrugBeginTime;
decimal yndden = 0;
_record.FactDrugList.ForEach(a => { if (a.DrugName == "氧气" && a.Velocity > 0) yndden = a.Velocity; });
if (yndden > 0)
{
dose += ((decimal)3.6) * yndden * item.Density * (decimal)Math.Round(timeSpan.TotalHours, 2) + (decimal)5.3;
}
}
return Math.Max(1, Math.Ceiling(dose));
default:
decimal totalDose = drugsRecords.Sum(item =>
{
if (item.Dosage > 0 && !string.IsNullOrEmpty(item.DosageUnit) && dosePerUnit != "")
{
decimal convertedDose = GetConvertValue(item.Dosage, item.DosageUnit, dosePerUnit);
return convertedDose;
}
else if (item.Velocity > 0 && !string.IsNullOrEmpty(item.VelocityUnit))
{
TimeSpan timeSpan = item.DrugEndTime - item.DrugBeginTime;
if (item.VelocityUnit.Contains("/h"))
{
return GetConvertValue(item.Velocity, item.VelocityUnit, dosePerUnit) * (decimal)Math.Round(timeSpan.TotalHours, 2);
}
else if (item.VelocityUnit.Contains("/min"))
{
return GetConvertValue(item.Velocity, item.VelocityUnit, dosePerUnit) * (decimal)Math.Round(timeSpan.TotalMinutes, 2);
}
}
return 0;
});
decimal calculatedDose = totalDose / dosePer;
return Math.Max(1, Math.Ceiling(calculatedDose));
}
}
public decimal GetConvertValue(decimal drugValue, string drugUnit, string ConUnit)
{
Dictionary<string, decimal> conversionFactors = new Dictionary<string, decimal>()
{
{"g", 1},
{"mg", 0.001m},
{"ug", 0.000001m},
{"l", 1000},
{"ml", 1}
};
string drugUnitKey = drugUnit.EndsWith("/h") || drugUnit.EndsWith("/min") ? drugUnit.Substring(0, drugUnit.Length - 3) : drugUnit;
string ConUnitKey = ConUnit.EndsWith("/h") || ConUnit.EndsWith("/min") ? ConUnit.Substring(0, ConUnit.Length - 3) : ConUnit;
if (drugUnitKey == ConUnitKey)
{
return drugValue;
}
if (conversionFactors.TryGetValue(drugUnitKey, out decimal drugFactor) && conversionFactors.TryGetValue(ConUnitKey, out decimal conFactor))
{
return drugValue * drugFactor / conFactor;
}
return 1;
}
private void SetChargDrugPrice()
{
int chargCount = 0;
double chargValue = 0;
double chargValue2 = 0;
foreach (DataGridViewRow item in _dataGridView.Rows)
foreach (DataGridViewRow item in dgvDrugs.Rows)
{
if (item.Cells[3].EditedFormattedValue.ToString() != "" && item.Cells[5].EditedFormattedValue.ToString() != "" && item.Cells[7].EditedFormattedValue.ToString() != "")
{
@ -246,8 +436,14 @@ namespace AIMS.PublicUI.UI
if (chargCount > 0)
{
lblDrugs.Text = string.Format(" 药品:{0}元 其他:{1}元 ", chargValue, chargValue2);
if (_record.InRoomTime != null && _record.OutRoomTime != null)
{
lblDrugs.Text += "在室时长:" + Math.Round(((TimeSpan)(_record.OutRoomTime - _record.InRoomTime)).TotalHours, 2) + " h ";
}
if (_record.AnesthesiaBeginTime != null && _record.AnesthesiaEndTime != null)
lblDrugs.Text += "麻醉时长:" + ((TimeSpan)(_record.AnesthesiaEndTime - _record.AnesthesiaBeginTime)).TotalHours + " 小时";
{
lblDrugs.Text += "麻醉时长:" + Math.Round(((TimeSpan)(_record.AnesthesiaEndTime - _record.AnesthesiaBeginTime)).TotalHours, 2) + " h";
}
}
else
{
@ -332,7 +528,7 @@ namespace AIMS.PublicUI.UI
if (row + i >= drugdt.Rows.Count) break;
int usedose = 0;
ButtonX lb = new ButtonX();
lb.Text = drugdt.Rows[row + i]["Name"].ToString().Trim() + " " + drugdt.Rows[row + i]["Price"].ToString().Trim();
lb.Text = drugdt.Rows[row + i]["Name"].ToString().Trim() + " " + drugdt.Rows[row + i]["Stand"].ToString().Trim() + " " + drugdt.Rows[row + i]["Price"].ToString().Trim();
lb.Tag = drugdt.Rows[row + i]["Id"].ToString();
lb.Font = new System.Drawing.Font("微软雅黑", 9.5f, FontStyle.Bold);
@ -368,6 +564,8 @@ namespace AIMS.PublicUI.UI
dr.Cells[4].Value = drug.Stand;
dr.Cells[5].Value = drug.Price;
dr.Cells[6].Value = drug.Unit;
dr.Cells[7].Value = "1";
dr.Cells[8].Value = drug.Price;
}
else
{
@ -379,6 +577,8 @@ namespace AIMS.PublicUI.UI
dr.Cells[4].Value = drug.Bill;
dr.Cells[5].Value = drug.Price;
dr.Cells[6].Value = drug.Unit;
dr.Cells[7].Value = "1";
dr.Cells[8].Value = drug.Price;
}
@ -636,6 +836,11 @@ namespace AIMS.PublicUI.UI
private void dgvDrugs_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
if (_dataGridView == null) return;
//判断如果事件名称列内容发生变化时(输入关键字),设置显示查询结果的控件的位置及内容
if (e.ColumnIndex == 3 || e.ColumnIndex == 7)
{
SetChargDrugPrice();
}
}
private void dgvDrugs_CurrentCellDirtyStateChanged(object sender, EventArgs e)
{
@ -721,12 +926,12 @@ namespace AIMS.PublicUI.UI
private void dgvDrugs_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
//判断类型
if (_dataGridView.CurrentCell != null && _dataGridView.CurrentCell.ColumnIndex != 6)
if (_dataGridView.CurrentCell != null)
{
if (dgvTxt != null)
{
dgvTxt.KeyPress -= new KeyPressEventHandler(dgvTxt_KeyPress); // 绑定事件
}
//if (dgvTxt != null)
//{
// dgvTxt.KeyPress -= new KeyPressEventHandler(dgvTxt_KeyPress); // 绑定事件
//}
if (_dataGridView.CurrentCell.ColumnIndex == 3)
{
dgvTextYP = (DataGridViewTextBoxEditingControl)e.Control; // 得到单元格
@ -743,7 +948,7 @@ namespace AIMS.PublicUI.UI
dgvTxt = (DataGridViewTextBoxEditingControl)e.Control; // 得到单元格
dgvTxt.KeyPress -= new KeyPressEventHandler(dgvTxt_KeyPress); // 绑定事件
dgvTxt.KeyPress += new KeyPressEventHandler(dgvTxt_KeyPress); // 绑定事件
SetChargDrugPrice();
//SetChargDrugPrice();
}
}
@ -793,6 +998,8 @@ namespace AIMS.PublicUI.UI
{
SetTempSelect(item);
}
AddNewNullRows();
dgvChargsRecord.ClearSelection();
SetChargDrugPrice();
};
frmChargSelect.ShowDialog();
@ -830,7 +1037,10 @@ namespace AIMS.PublicUI.UI
private void SetDGV(Charges item)
{
int index = dgvChargsRecord.Rows.Add();
int index;
if (dgvChargsRecord.Rows[dgvChargsRecord.Rows.Count - 1].Cells[3].Tag == null) index = dgvChargsRecord.Rows[dgvChargsRecord.Rows.Count - 1].Index;
else
index = dgvChargsRecord.Rows.Add();
dgvChargsRecord.Rows[index].Cells[1].Value = item.Class;
dgvChargsRecord.Rows[index].Cells[2].Value = item.Code;
dgvChargsRecord.Rows[index].Cells[3].Value = item.Name;
@ -847,8 +1057,6 @@ namespace AIMS.PublicUI.UI
dgvChargsRecord.Rows[index].Cells[8].Value = rowprice;
}
dgvChargsRecord.ClearSelection();
}
SuperTabControl stc = new SuperTabControl();
@ -965,6 +1173,8 @@ namespace AIMS.PublicUI.UI
_dataGridView.CurrentRow.Cells[4].Value = dgvYP.Rows[index].Cells["Norm"].Value.ToString();
_dataGridView.CurrentRow.Cells[5].Value = dgvYP.Rows[index].Cells["Price"].Value.ToString();
_dataGridView.CurrentRow.Cells[6].Value = dgvYP.Rows[index].Cells["Unit"].Value.ToString();
_dataGridView.CurrentRow.Cells[7].Value = "1";
_dataGridView.CurrentRow.Cells[8].Value = dgvYP.Rows[index].Cells["Price"].Value.ToString();
index = 0;
dgvYP.Visible = false;
AddNewNullRows();
@ -1230,6 +1440,8 @@ namespace AIMS.PublicUI.UI
private void bynPrint_Click(object sender, EventArgs e)
{
btnSave_Click(null, null);
GoldPrinter.ExcelAccess excel = new GoldPrinter.ExcelAccess();
string strFileName = "麻醉收费单.xlt"; //模板文件名
string strExcelTemplateFile = Application.StartupPath;
@ -1237,15 +1449,23 @@ namespace AIMS.PublicUI.UI
excel.Open(strExcelTemplateFile); //用模板文件
excel.SetCellText(2, "A", PublicMethod.GetHospitalName());
excel.SetCellText(39, "D", _worker.Name);
excel.SetCellText(39, "G", DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
excel.SetCellText(4, "B", _record.InRoomTime.Value.ToString("yyyy-MM-dd"));
excel.SetCellText(4, "E", _record.ApplyDepartmentName.ToString());
excel.SetCellText(4, "H", _record.InHospitalNo);
excel.SetCellText(5, "B", _record.Name);
excel.SetCellText(5, "E", DBManage.GetDictionaryValuesById(_record.Operation, "手术"));
if (_record.AnesthesiaBeginTime != null && _record.AnesthesiaEndTime != null)
excel.SetCellText(38, "D", "麻醉时长:" + ((TimeSpan)(_record.AnesthesiaEndTime - _record.AnesthesiaBeginTime)).TotalHours + " 小时");
excel.SetCellText(5, "B", _record.Name + " (" + _record.Sex + " " + _record.Age + ")");
excel.SetCellText(5, "H", _record.Identity);
excel.SetCellText(5, "E", DBManage.GetDictionaryValuesById(_record.Applydiagnose, "诊断"));
excel.SetCellText(38, "B", lblDrugs.Text);
excel.SetCellText(39, "B", _worker.Name);
if (_record.OperationDoctor != null && _record.OperationDoctor.Trim() != "")
{
string AnesthesiaDoctor = _record.OperationDoctor;
if (AnesthesiaDoctor.Contains(',')) AnesthesiaDoctor = AnesthesiaDoctor.Split(',')[0];
Person son = BPerson.SelectSingle(" id in (" + AnesthesiaDoctor + ")", null, RecursiveType.Parent, 1);
if (son != null)
excel.SetCellText(39, "D", son.Name);
}
excel.SetCellText(39, "G", DateTime.Now.ToString("yyyy-MM-dd HH:mm"));
int rowNum = 6;
for (int i = 0; i < dgvDrugs.Rows.Count; i++)
{
@ -1260,8 +1480,7 @@ namespace AIMS.PublicUI.UI
( dr.Cells[4].EditedFormattedValue.ToString()),
dr.Cells[7].EditedFormattedValue.ToString(),
( dr.Cells[6].EditedFormattedValue.ToString() ) ,
(dr.Cells[8].EditedFormattedValue.ToString() )
};
(dr.Cells[8].EditedFormattedValue.ToString() ) };
}
}
for (int i = 0; i < dgvChargsRecord.Rows.Count; i++)

View File

@ -146,7 +146,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAa
CAAAAk1TRnQBSQFMAgEBAgEAAZABBwGQAQcBFAEAARQBAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFQ
CAAAAk1TRnQBSQFMAgEBAgEAAZgBBwGYAQcBFAEAARQBAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFQ
AwABFAMAAQEBAAEgBgABGS4AA1UBrwOAAf4DKwH8AysB/AGZAYsBQAH9AaEBkgEAAf8BkwGCAQAB/wGW
AYcBQAH9AaMBlAEAAf8BowGUAQAB/wGjAZQBAAH/AysB/ANgAej/AA0AAZMBggEAAf8DYgH2A20B9wNt
AfcDXAH4A4AB/gGXAYYBAAH/A20B9wHsAecB5AH/AewB5wHkAf8B7AHnAeQB/wNtAfcBkwGCAQAB//8A

View File

@ -13,8 +13,6 @@ namespace AIMS.OperationAanesthesia
{
public static class PublicToDoument
{
/// <summary>
/// 反序列化数据加载到控件
/// </summary>
@ -136,104 +134,6 @@ namespace AIMS.OperationAanesthesia
list.Add(model = new JsonTextForDoc { Id = c.Name, Value = ((DateTimeInput)c).Value.ToString(), Type = "Date", Tag = c.Tag.ToString() });
}
}
//else if (c is PictureBox)
//{
// if (((PictureBox)c).Image != null)
// {
// list.Add(model = new JsonTextForDoc { Id = c.Name, Value = Convert.ToBase64String(ImageToBytes(((PictureBox)c).Image)), Type = "Image", Tag = c.Tag.ToString() });
// }
//}
//if (c.Tag != null && c.Tag.ToString().Split('|').Count() > 1 && model.Value != null)
//{
// dicList.Add(c.Tag.ToString().Split('|')[1], model.Value);
//}
}
}
public static byte[] ImageToBytes(Image image)
{
//该方法不一定传进来的是Image对象还可能是Bitmap对象所以获取当前Image的格式会出问题 同一执行png格式
//ImageFormat format = image.RawFormat;
using (MemoryStream ms = new MemoryStream())
{
image.Save(ms, ImageFormat.Png);
return ms.ToArray();
}
}
/// <summary>
/// Byte[]转Image
/// </summary>
/// <param name="buffer"></param>
/// <returns></returns>
public static Image BytesToImage(this byte[] buffer)
{
MemoryStream ms = new MemoryStream(buffer);
Image image = Image.FromStream(ms);
return image;
}
//public static void SavePrintDocStatic(Dictionary<string, string> dicList, int modelId, int ApplyId)
//{
// try
// {
// if (modelId != 0) BDocumentManager.DeleteStatic(modelId, ApplyId);
// List<PrintDocStatic> modelStatics = new List<PrintDocStatic>();
// foreach (var key in dicList.Keys)
// {
// PrintDocStatic modelStatic = new PrintDocStatic
// {
// PrintDocId = modelId,
// OperationApplyId = ApplyId,
// Key = key,
// Value = dicList[key],
// OperatorId = PublicMethod.Operator.Id
// };
// modelStatics.Add(modelStatic);
// }
// BDocumentManager.InsertStatic(modelStatics);
// }
// catch (Exception ex)
// {
// }
//}
public static void InsertPicture(GoldPrinter.ExcelAccess excel, FileInfo Img, float PictuteWidth, float PictureHeight)
{
try
{
string imgname = Img.Name.Split('.')[0];
Microsoft.Office.Interop.Excel.Worksheet xSheet = (Microsoft.Office.Interop.Excel.Worksheet)excel.Workbooks.Sheets[1];
Microsoft.Office.Interop.Excel.Range m_objRange = xSheet.Range[imgname, System.Reflection.Missing.Value];
m_objRange.Select();
float PicLeft, PicTop;
PicLeft = Convert.ToSingle(m_objRange.Left);
PicTop = Convert.ToSingle(m_objRange.Top);// + 460;
//参数含义:
//图片路径
//是否链接到文件
//图片插入时是否随文档一起保存
//图片在文档中的坐标位置单位points
//图片显示的宽度和高度单位points
//参数详细信息参见http://msdn2.microsoft.com/zh-cn/library/aa221765(office.11).aspx
//xSheet.Shapes.AddPicture(Img.Attributes.ToString(), MsoTriState.msoFalse,
//MsoTriState.msoTrue, PicLeft, PicTop, PictuteWidth, PictureHeight);
xSheet.Shapes.AddPicture(Img.FullName, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoTrue, PicLeft, PicTop, PictuteWidth, PictureHeight);
}
catch (Exception)
{
}
}
public static void SetExcelValue(Control cons, GoldPrinter.ExcelAccess excel, bool addHospitalName = true)
{
try
{
SetExcelValues(cons, excel);
}
catch (Exception ex)
{
PublicMethod.WriteLog(ex);
}
}

View File

@ -0,0 +1,156 @@
using AIMS;
using AIMSBLL;
using AIMSExtension;
using AIMSModel;
using DCSoftDotfuscate;
using DevComponents.DotNetBar.Controls;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace KHD_OREMR.UserControls
{
public partial class frmExportConfig : Form
{
public SysConfig exportConfig;
public DataGridView _dgv;
public string DataGridViewPath;
public string SysName;
private frmExportConfig()
{
InitializeComponent();
this.FormBorderStyle = FormBorderStyle.FixedSingle;
}
public frmExportConfig(DataGridView dgv, SysConfig _exportConfig, string dataGridViewPath, string name)
{
InitializeComponent();
this._dgv = dgv;
this.exportConfig = _exportConfig;
DataGridViewPath = dataGridViewPath;
SysName = name;
}
private void frmSelGridColusView_Load(object sender, EventArgs e)
{
if (_dgv == null) return;
LoadSettingSource(_dgv);
if (exportConfig != null)
{
ExportConfig dataGridViewSetting = JsonConvert.DeserializeObject<ExportConfig>(exportConfig.Value);
txtName.Text = dataGridViewSetting.Title;
txtFontSize.Value = dataGridViewSetting.FontSize;
cmbIsHD.Checked = dataGridViewSetting.Landscape;
foreach (DataGridViewRow column in dataGridView2.Rows)
{
foreach (var item in dataGridViewSetting.exports)
{
if (column.Cells[0].Value.ToString() == item.Name)
{
column.Cells["widthDataGridViewTextBoxColumn"].Value = item.Width;
column.Cells["visibleDataGridViewCheckBoxColumn"].Value = item.IsVisible;
column.Cells["printShow"].Value = item.IsPrint;
column.Cells["printWidth"].Value = item.PrintWidth;
column.Cells["PrintSize"].Value = item.PrintSize;
}
}
}
}
else
{
exportConfig = new SysConfig();
txtName.Text = Name;
txtFontSize.Value = 9;
cmbIsHD.Checked = true;
foreach (DataGridViewRow column in dataGridView2.Rows)
{
column.Cells["printShow"].Value = true;
column.Cells["printWidth"].Value = 8;
column.Cells["PrintSize"].Value = 8;
}
}
}
private void LoadSettingSource(DataGridView dgv)
{
int _lineNumber = 0;
foreach (DataGridViewColumn dataGridViewColumn in dgv.Columns)
{
DataGridViewRow drc = new DataGridViewRow();
drc.CreateCells(dataGridView2);
drc.Cells[0].Value = dataGridViewColumn.Name;
drc.Cells[1].Value =dataGridViewColumn.HeaderText;
drc.Cells[2].Value = dataGridViewColumn.MinimumWidth;
drc.Cells[3].Value = dataGridViewColumn.ReadOnly;
drc.Cells[4].Value = dataGridViewColumn.Visible;
drc.Cells[5].Value = dataGridViewColumn.Width;
dataGridView2.Rows.Insert(_lineNumber, drc);
_lineNumber++;
}
}
private void tsbCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void tsbSave_Click(object sender, EventArgs e)
{
EndEdit();
exportConfig.Name = txtName.Text;
exportConfig.Note = DataGridViewPath;
ExportConfig dataGridViewSetting = CreateDataGridViewSetting(dataGridView2);
exportConfig.Value = JsonConvert.SerializeObject(dataGridViewSetting);
exportConfig.IsValid = 1;
exportConfig.OperatorNo = PublicMethod.OperatorNo;
exportConfig.OperatorName = PublicMethod.OperatorName;
exportConfig.OperateDate = DateTime.Now;
if (exportConfig.Id != null && exportConfig.Id.Value > 0)
{
BSysConfig.Update(exportConfig);
}
else
{
exportConfig.Id = BSysConfig.Insert(exportConfig);
}
DialogResult = DialogResult.OK;
Close();
}
private ExportConfig CreateDataGridViewSetting(DataGridView dataGridView)
{
ExportConfig dataGridViewSetting = new ExportConfig();
dataGridViewSetting.Title = txtName.Text;
dataGridViewSetting.Path = DataGridViewPath;
dataGridViewSetting.FontSize = int.Parse(txtFontSize.Value.ToString());
dataGridViewSetting.Landscape = cmbIsHD.Checked;
dataGridViewSetting.exports = new List<ExportItem>();
foreach (DataGridViewRow column in dataGridView.Rows)
{
ExportItem export = new ExportItem();
export.Name = column.Cells["dataPropertyNameDataGridViewTextBoxColumn"].Value.ToString();
export.Text = column.Cells["headerTextDataGridViewTextBoxColumn"].Value.ToString();
export.PrintName = column.Cells["headerTextDataGridViewTextBoxColumn"].Value.ToString();
export.Width = int.Parse(column.Cells["widthDataGridViewTextBoxColumn"].Value.ToString());
export.IsVisible = bool.Parse(column.Cells["visibleDataGridViewCheckBoxColumn"].Value.ToString());
export.IsPrint = bool.Parse(column.Cells["printShow"].Value.ToString());
export.PrintWidth = int.Parse(column.Cells["printWidth"].Value.ToString());
export.PrintSize = int.Parse(column.Cells["PrintSize"].Value.ToString());
dataGridViewSetting.exports.Add(export);
}
return dataGridViewSetting;
}
private void EndEdit()
{
this.Validate();
}
}
}

View File

@ -0,0 +1,307 @@
namespace KHD_OREMR.UserControls
{
partial class frmExportConfig
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.tsbCancel = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.tsbSave = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.gbDataGridViewSetting = new System.Windows.Forms.GroupBox();
this.cmbIsHD = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.txtFontSize = new System.Windows.Forms.NumericUpDown();
this.txtName = new DevComponents.DotNetBar.Controls.TextBoxX();
this.labelX2 = new DevComponents.DotNetBar.LabelX();
this.labelX1 = new DevComponents.DotNetBar.LabelX();
this.dataGridView2 = new System.Windows.Forms.DataGridView();
this.dataPropertyNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.headerTextDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.minimumWidthDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.readOnlyDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.visibleDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.widthDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.printShow = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.printWidth = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.PrintSize = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.toolStrip1.SuspendLayout();
this.gbDataGridViewSetting.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.txtFontSize)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
this.SuspendLayout();
//
// toolStrip1
//
this.toolStrip1.BackColor = System.Drawing.Color.AliceBlue;
this.toolStrip1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.toolStrip1.ImageScalingSize = new System.Drawing.Size(30, 30);
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbCancel,
this.toolStripSeparator3,
this.tsbSave,
this.toolStripSeparator1});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(913, 27);
this.toolStrip1.TabIndex = 438;
this.toolStrip1.Text = "toolStrip1";
//
// tsbCancel
//
this.tsbCancel.ImageTransparentColor = System.Drawing.Color.Transparent;
this.tsbCancel.Name = "tsbCancel";
this.tsbCancel.Size = new System.Drawing.Size(60, 24);
this.tsbCancel.Text = "取消(&C)";
this.tsbCancel.Click += new System.EventHandler(this.tsbCancel_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(6, 27);
//
// tsbSave
//
this.tsbSave.ImageTransparentColor = System.Drawing.Color.Transparent;
this.tsbSave.Name = "tsbSave";
this.tsbSave.Size = new System.Drawing.Size(59, 24);
this.tsbSave.Text = "保存(&S)";
this.tsbSave.ToolTipText = "保存";
this.tsbSave.Click += new System.EventHandler(this.tsbSave_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 27);
//
// gbDataGridViewSetting
//
this.gbDataGridViewSetting.BackColor = System.Drawing.Color.AliceBlue;
this.gbDataGridViewSetting.Controls.Add(this.cmbIsHD);
this.gbDataGridViewSetting.Controls.Add(this.txtFontSize);
this.gbDataGridViewSetting.Controls.Add(this.txtName);
this.gbDataGridViewSetting.Controls.Add(this.labelX2);
this.gbDataGridViewSetting.Controls.Add(this.labelX1);
this.gbDataGridViewSetting.Dock = System.Windows.Forms.DockStyle.Top;
this.gbDataGridViewSetting.Location = new System.Drawing.Point(0, 27);
this.gbDataGridViewSetting.Name = "gbDataGridViewSetting";
this.gbDataGridViewSetting.Size = new System.Drawing.Size(913, 74);
this.gbDataGridViewSetting.TabIndex = 445;
this.gbDataGridViewSetting.TabStop = false;
this.gbDataGridViewSetting.Text = "设置";
//
// cmbIsHD
//
//
//
//
this.cmbIsHD.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.cmbIsHD.Location = new System.Drawing.Point(496, 29);
this.cmbIsHD.Name = "cmbIsHD";
this.cmbIsHD.Size = new System.Drawing.Size(100, 23);
this.cmbIsHD.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.cmbIsHD.TabIndex = 3;
this.cmbIsHD.Text = "是否横向打印";
//
// txtFontSize
//
this.txtFontSize.Location = new System.Drawing.Point(375, 26);
this.txtFontSize.Name = "txtFontSize";
this.txtFontSize.Size = new System.Drawing.Size(69, 26);
this.txtFontSize.TabIndex = 2;
//
// txtName
//
//
//
//
this.txtName.Border.Class = "TextBoxBorder";
this.txtName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.txtName.Location = new System.Drawing.Point(105, 26);
this.txtName.Name = "txtName";
this.txtName.PreventEnterBeep = true;
this.txtName.Size = new System.Drawing.Size(165, 26);
this.txtName.TabIndex = 1;
//
// labelX2
//
//
//
//
this.labelX2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX2.Location = new System.Drawing.Point(299, 29);
this.labelX2.Name = "labelX2";
this.labelX2.Size = new System.Drawing.Size(75, 23);
this.labelX2.TabIndex = 0;
this.labelX2.Text = "打印字体";
//
// labelX1
//
//
//
//
this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX1.Location = new System.Drawing.Point(26, 29);
this.labelX1.Name = "labelX1";
this.labelX1.Size = new System.Drawing.Size(75, 23);
this.labelX1.TabIndex = 0;
this.labelX1.Text = "打印标题";
//
// dataGridView2
//
this.dataGridView2.AllowUserToAddRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(239)))), ((int)(((byte)(247)))), ((int)(((byte)(255)))));
this.dataGridView2.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dataGridView2.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dataGridView2.BackgroundColor = System.Drawing.Color.White;
this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dataPropertyNameDataGridViewTextBoxColumn,
this.headerTextDataGridViewTextBoxColumn,
this.minimumWidthDataGridViewTextBoxColumn,
this.readOnlyDataGridViewCheckBoxColumn,
this.visibleDataGridViewCheckBoxColumn,
this.widthDataGridViewTextBoxColumn,
this.printShow,
this.printWidth,
this.PrintSize});
this.dataGridView2.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGridView2.Location = new System.Drawing.Point(0, 101);
this.dataGridView2.Name = "dataGridView2";
this.dataGridView2.RowHeadersVisible = false;
this.dataGridView2.RowTemplate.Height = 23;
this.dataGridView2.Size = new System.Drawing.Size(913, 343);
this.dataGridView2.TabIndex = 440;
//
// dataPropertyNameDataGridViewTextBoxColumn
//
this.dataPropertyNameDataGridViewTextBoxColumn.DataPropertyName = "Name";
this.dataPropertyNameDataGridViewTextBoxColumn.HeaderText = "数据源名称";
this.dataPropertyNameDataGridViewTextBoxColumn.Name = "dataPropertyNameDataGridViewTextBoxColumn";
this.dataPropertyNameDataGridViewTextBoxColumn.Visible = false;
//
// headerTextDataGridViewTextBoxColumn
//
this.headerTextDataGridViewTextBoxColumn.DataPropertyName = "HeaderText";
this.headerTextDataGridViewTextBoxColumn.HeaderText = "标题";
this.headerTextDataGridViewTextBoxColumn.Name = "headerTextDataGridViewTextBoxColumn";
//
// minimumWidthDataGridViewTextBoxColumn
//
this.minimumWidthDataGridViewTextBoxColumn.DataPropertyName = "MinimumWidth";
this.minimumWidthDataGridViewTextBoxColumn.HeaderText = "最小宽度";
this.minimumWidthDataGridViewTextBoxColumn.Name = "minimumWidthDataGridViewTextBoxColumn";
this.minimumWidthDataGridViewTextBoxColumn.Visible = false;
//
// readOnlyDataGridViewCheckBoxColumn
//
this.readOnlyDataGridViewCheckBoxColumn.DataPropertyName = "ReadOnly";
this.readOnlyDataGridViewCheckBoxColumn.HeaderText = "只读";
this.readOnlyDataGridViewCheckBoxColumn.Name = "readOnlyDataGridViewCheckBoxColumn";
this.readOnlyDataGridViewCheckBoxColumn.Visible = false;
//
// visibleDataGridViewCheckBoxColumn
//
this.visibleDataGridViewCheckBoxColumn.DataPropertyName = "Visible";
this.visibleDataGridViewCheckBoxColumn.HeaderText = "是否可见";
this.visibleDataGridViewCheckBoxColumn.Name = "visibleDataGridViewCheckBoxColumn";
//
// widthDataGridViewTextBoxColumn
//
this.widthDataGridViewTextBoxColumn.DataPropertyName = "Width";
this.widthDataGridViewTextBoxColumn.HeaderText = "宽度";
this.widthDataGridViewTextBoxColumn.Name = "widthDataGridViewTextBoxColumn";
//
// printShow
//
this.printShow.HeaderText = "是否打印";
this.printShow.Name = "printShow";
this.printShow.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.printShow.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// printWidth
//
this.printWidth.HeaderText = "打印宽度";
this.printWidth.Name = "printWidth";
//
// PrintSize
//
this.PrintSize.HeaderText = "字体大小";
this.PrintSize.Name = "PrintSize";
this.PrintSize.Visible = false;
//
// frmExportConfig
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(913, 444);
this.Controls.Add(this.dataGridView2);
this.Controls.Add(this.gbDataGridViewSetting);
this.Controls.Add(this.toolStrip1);
this.Font = new System.Drawing.Font("微软雅黑", 10.5F);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmExportConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "导出设置";
this.Load += new System.EventHandler(this.frmSelGridColusView_Load);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.gbDataGridViewSetting.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.txtFontSize)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.GroupBox gbDataGridViewSetting;
public System.Windows.Forms.ToolStripButton tsbSave;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.DataGridView dataGridView2;
private System.Windows.Forms.ToolStripButton tsbCancel;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private DevComponents.DotNetBar.Controls.TextBoxX txtName;
private DevComponents.DotNetBar.LabelX labelX1;
private DevComponents.DotNetBar.Controls.CheckBoxX cmbIsHD;
private System.Windows.Forms.NumericUpDown txtFontSize;
private DevComponents.DotNetBar.LabelX labelX2;
private System.Windows.Forms.DataGridViewTextBoxColumn dataPropertyNameDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn headerTextDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn minimumWidthDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewCheckBoxColumn readOnlyDataGridViewCheckBoxColumn;
private System.Windows.Forms.DataGridViewCheckBoxColumn visibleDataGridViewCheckBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn widthDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewCheckBoxColumn printShow;
private System.Windows.Forms.DataGridViewTextBoxColumn printWidth;
private System.Windows.Forms.DataGridViewTextBoxColumn PrintSize;
}
}

View File

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>15, 7</value>
</metadata>
<metadata name="printShow.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="printWidth.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="PrintSize.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>32</value>
</metadata>
</root>

View File

@ -32,6 +32,8 @@
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.tsbReviewApply = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.tspSetting = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.tsbExportExcel = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.tsbPrint = new System.Windows.Forms.ToolStripButton();
@ -135,6 +137,8 @@
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbReviewApply,
this.toolStripSeparator1,
this.tspSetting,
this.toolStripSeparator4,
this.tsbExportExcel,
this.toolStripSeparator3,
this.tsbPrint,
@ -164,6 +168,22 @@
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 49);
this.toolStripSeparator1.Visible = false;
//
// tspSetting
//
this.tspSetting.Font = new System.Drawing.Font("微软雅黑", 9F);
this.tspSetting.Image = global::AIMS.Properties.Resources._设置;
this.tspSetting.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tspSetting.Name = "tspSetting";
this.tspSetting.Size = new System.Drawing.Size(68, 46);
this.tspSetting.Text = " 导出设置";
this.tspSetting.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
this.tspSetting.Click += new System.EventHandler(this.tspSetting_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(6, 49);
//
// tsbExportExcel
//
this.tsbExportExcel.Font = new System.Drawing.Font("微软雅黑", 9F);
@ -715,7 +735,7 @@
// ApplyId
//
this.ApplyId.DataPropertyName = "ApplyId";
this.ApplyId.HeaderText = "ApplyId";
this.ApplyId.HeaderText = "序号";
this.ApplyId.Name = "ApplyId";
this.ApplyId.ReadOnly = true;
this.ApplyId.Visible = false;
@ -1118,6 +1138,8 @@
private System.Windows.Forms.ComboBox cmbOpeType;
private System.Windows.Forms.ComboBox cboDepartment;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ToolStripButton tspSetting;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.DataGridViewCheckBoxColumn CheckBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn ApplyId;
private System.Windows.Forms.DataGridViewTextBoxColumn StateColumn;

View File

@ -1,15 +1,23 @@
using AIMSBLL;
using AIMSExtension;
using AIMSModel;
using DataDictionary;
using DevComponents.DotNetBar.Controls;
using KHD_OREMR.UserControls;
using Microsoft.Office.Interop.Excel;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
namespace AIMS.OperationAfter.UI
{
@ -19,7 +27,8 @@ namespace AIMS.OperationAfter.UI
{
InitializeComponent();
}
public SysConfig exportConfig;
public string DataGridViewPath = "";
private void frmOperationManage_Load(object sender, EventArgs e)
{
//1.系统管理员 7.麻醉主任 8.麻醉护士 9.麻醉医生
@ -29,10 +38,12 @@ namespace AIMS.OperationAfter.UI
toolStripSeparator1.Visible = true;
}
dgv.AutoGenerateColumns = false;
ControlExtension.SetDgvAttribute(dgv);
dgv.BackgroundColor = System.Drawing.Color.Snow;
ControlExtension.SetDgvAttribute(dgv);
DataGridViewPath = GetControlPath(dgv);
exportConfig = BSysConfig.SelectSingle(" Note='" + DataGridViewPath + "'", null, RecursiveType.None, 0);
if (exportConfig != null)
ConfigDataGridView(exportConfig);
List<Department> list = new List<Department>();
list = BDepartment.GetDepartmentAllList();
list.Insert(0, new Department
@ -155,7 +166,7 @@ namespace AIMS.OperationAfter.UI
string level = cboOperationLevel.Text;
string asa = txtASALevel.Text;
DataTable dt = BOperationApply.GetOperationDoingDataTable(dtpBegInDate.Value.ToString("yyyy-MM-dd"), dtpEndDate.Value.AddDays(1).ToString("yyyy-MM-dd"));
System.Data.DataTable dt = BOperationApply.GetOperationDoingDataTable(dtpBegInDate.Value.ToString("yyyy-MM-dd"), dtpEndDate.Value.AddDays(1).ToString("yyyy-MM-dd"));
string Where = "";
if (state == "")
Where += " StateId >1 ";
@ -183,13 +194,13 @@ namespace AIMS.OperationAfter.UI
Where += " and (OperationDoctor LIKE '%" + name + "%' or Assistant LIKE '%" + name + "%' or AnesthesiaDoctor LIKE '%" + name + "%' or InstrumentNurse LIKE '%" + name + "%' or TourNurse LIKE '%" + name + "%' ) ";
if (AgeBegin.Value != 0 || AgeEnd.Value != 100)
{
Where += " and (AgeNum >="+AgeBegin.Value+" and AgeNum <="+ AgeEnd.Value+") ";
Where += " and (AgeNum >=" + AgeBegin.Value + " and AgeNum <=" + AgeEnd.Value + ") ";
}
if (cboIsNotPlanReturnOperation.Checked == true)
Where += " and IsNotPlanReturnOperation ='是' ";
if (txtOperation.Text != "")
Where += " and (ApplyOperationInfoName LIKE '%" + txtOperation.Text + "%' or OperationInfoName LIKE '%" + txtOperation.Text + "%' ) ";
DataTable dataTable = AIMSExtension.PublicMethod.GetNewDataTable(dt, Where, "");
System.Data.DataTable dataTable = AIMSExtension.PublicMethod.GetNewDataTable(dt, Where, "");
foreach (DataRow item in dataTable.Rows)
{
if (item["StateId"].ToString() != "10" && item["StateId"].ToString() != "10")
@ -239,73 +250,178 @@ namespace AIMS.OperationAfter.UI
private void tsbExportExcel_Click(object sender, EventArgs e)
{
DataToExcel(dgv);
//DataToExcel(dgv);
KillAllExcel();
ExprotExcel2();
}
private Microsoft.Office.Interop.Excel.Application myExcel = null;
private void ExprotExcel2(bool isPrint = false)
{
//自定义表头
string title = "查询管理数据";
if (dataGridViewSetting != null) title = dataGridViewSetting.Title;
//是否横向
bool xlLandscape = true;
if (dataGridViewSetting != null && dataGridViewSetting.Landscape == false) xlLandscape = false;
//主体字体大小
int BodySize = 9;
if (dataGridViewSetting != null && dataGridViewSetting.FontSize > 0) BodySize = dataGridViewSetting.FontSize;
myExcel = new Microsoft.Office.Interop.Excel.Application();
this.Cursor = Cursors.WaitCursor;
//保存文化环境
System.Globalization.CultureInfo CurrentCI = System.Threading.Thread.CurrentThread.CurrentCulture;
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
Workbook workbookData = myExcel.Workbooks.Add(Missing.Value);
Worksheet xlSheet = (Microsoft.Office.Interop.Excel.Worksheet)workbookData.Worksheets[1];
xlSheet.Name = title;
if (isPrint == false)
myExcel.Visible = true;
myExcel.Cells[1, 1] = title;//默认的就是在sheet1里面的。
WorksheetClass wsClass = new WorksheetClass();
Dictionary<int, string> Columns = new Dictionary<int, string>();
//填充标题
for (int i = 0; i < dgv.Columns.Count; i++)
{
if (dataGridViewSetting != null)
{
foreach (var item in dataGridViewSetting.exports)
{
if (dgv.Columns[i].Name == item.Name)
{
if (item.IsPrint == true)
{
Columns.Add(i, dgv.Columns[i].HeaderText);
continue;
}
/// <summary>
/// DataGridView转Excel
/// </summary>
/// <param name="m_DataView"></param>
public static void DataToExcel(DataGridView m_DataView)
{
SaveFileDialog kk = new SaveFileDialog();
kk.Title = "保存EXECL文件";
kk.Filter = "EXECL文件(*.xls) |*.xls |所有文件(*.*) |*.*";
kk.FilterIndex = 1;
if (kk.ShowDialog() == DialogResult.OK)
{
string FileName = kk.FileName ;
if (File.Exists(FileName))
File.Delete(FileName);
FileStream objFileStream;
StreamWriter objStreamWriter;
string strLine = "";
objFileStream = new FileStream(FileName, FileMode.OpenOrCreate, FileAccess.Write);
objStreamWriter = new StreamWriter(objFileStream, System.Text.Encoding.Unicode);
for (int i = 0; i < m_DataView.Columns.Count; i++)
{
if (m_DataView.Columns[i].Visible == true)
{
strLine = strLine + m_DataView.Columns[i].HeaderText.ToString() + Convert.ToChar(9);
}
}
objStreamWriter.WriteLine(strLine);
strLine = "";
}
else
{
if (dgv.Columns[i].Visible == true)
Columns.Add(i, dgv.Columns[i].HeaderText);
}
}
for (int i = 0; i < m_DataView.Rows.Count; i++)
List<KeyValuePair<int, string>> ColumnsStr = Columns.ToList();
for (int i = 0; i < ColumnsStr.Count; i++)
{
if (m_DataView.Columns[0].Visible == true)
myExcel.Cells[2, i + 1] = ColumnsStr[i].Value;
if (dataGridViewSetting != null)
{
if (m_DataView.Rows[i].Cells[0].Value == null)
strLine = strLine + " " + Convert.ToChar(9);
else
strLine = strLine + m_DataView.Rows[i].Cells[0].Value.ToString() + Convert.ToChar(9);
foreach (var item in dataGridViewSetting.exports)
{
if (ColumnsStr[i].Value == item.Text)
{
xlSheet.get_Range(xlSheet.Cells[2, i + 1], xlSheet.Cells[2, i + 1]).ColumnWidth = item.PrintWidth;//列宽
}
}
}
for (int j = 1; j < m_DataView.Columns.Count; j++)
{
if (m_DataView.Columns[j].Visible == true)
{
if (m_DataView.Rows[i].Cells[j].Value == null)
strLine = strLine + " " + Convert.ToChar(9);
else
{
string rowstr = "";
rowstr = m_DataView.Rows[i].Cells[j].Value.ToString();
if (rowstr.IndexOf("\r\n") > 0)
rowstr = rowstr.Replace("\r\n", " ");
if (rowstr.IndexOf("\t") > 0)
rowstr = rowstr.Replace("\t", " ");
strLine = strLine + rowstr + Convert.ToChar(9);
xlSheet.get_Range(xlSheet.Cells[2, i + 1], xlSheet.Cells[2, i + 1]).ColumnWidth = 5;//列宽
}
}
//获得数据表的值
int RowCount = dgv.Rows.Count;
int colCount = ColumnsStr.Count;
//设置填充单元格样式
xlSheet.get_Range(xlSheet.Cells[2, 1], xlSheet.Cells[RowCount + 2, colCount]).Borders.LineStyle = XlLineStyle.xlContinuous;//边框的样式
object[,] objData = new object[RowCount, colCount];
//将DataTable里的值填充到对象数组中
for (int i = 0; i < RowCount; i++)
{
for (int j = 0; j < colCount; j++)
{
if (dgv.Columns[ColumnsStr[j].Key].Name == "序号" || dgv.Columns[ColumnsStr[j].Key].Name == "ApplyId")
objData[i, j] = i + 1;
else if (dgv.Rows[i].Cells[ColumnsStr[j].Key].Value != null)
objData[i, j] = dgv.Rows[i].Cells[ColumnsStr[j].Key].Value.ToString();
}
System.Windows.Forms.Application.DoEvents();
}
//将对象数组的值赋值给Excel
Range range = xlSheet.get_Range(xlSheet.Cells[3, 1], xlSheet.Cells[RowCount + 2, colCount]);
range.Value2 = objData;
//xlSheet.get_Range(xlSheet.Cells[2, 1], xlSheet.Cells[RowCount + 2, colCount]).Font.Size = BodySize;//字体大小
//设置主标题单元格的样式
xlSheet.get_Range(xlSheet.Cells[1, 1], xlSheet.Cells[1, colCount]).MergeCells = true;//合并单元格
xlSheet.get_Range(xlSheet.Cells[1, 1], xlSheet.Cells[1, colCount]).HorizontalAlignment = XlHAlign.xlHAlignCenter;//水平对齐方式
xlSheet.get_Range(xlSheet.Cells[1, 1], xlSheet.Cells[1, colCount]).VerticalAlignment = XlVAlign.xlVAlignBottom;//垂直对齐方式
xlSheet.get_Range(xlSheet.Cells[1, 1], xlSheet.Cells[1, colCount]).Font.Bold = true;//字体加粗
xlSheet.get_Range(xlSheet.Cells[1, 1], xlSheet.Cells[1, colCount]).Font.ColorIndex = 0;//字体颜色
//xlSheet.get_Range(xlSheet.Cells[1, 1], xlSheet.Cells[1, colCount]).Font.Italic = true;//是否斜体
xlSheet.get_Range(xlSheet.Cells[1, 1], xlSheet.Cells[1, colCount]).Font.Size = 22;//字体大小
xlSheet.get_Range(xlSheet.Cells[1, 1], xlSheet.Cells[1, colCount]).Borders.LineStyle = XlLineStyle.xlContinuous;//边框样式
xlSheet.get_Range(xlSheet.Cells[1, 1], xlSheet.Cells[1, colCount]).RowHeight = 33.75;//行高
//设置标题单元格样式
xlSheet.get_Range(xlSheet.Cells[2, 1], xlSheet.Cells[2, colCount]).RowHeight = 22.75;//行高
if (xlLandscape == true)
xlSheet.PageSetup.Orientation = XlPageOrientation.xlLandscape;//页面方向为横向
//恢复文化环境
System.Threading.Thread.CurrentThread.CurrentCulture = CurrentCI;
try
{
if (isPrint == true)
xlSheet.PrintOutEx();
//myExcel.Save(@"D:a.xls");
//myExcel.Quit();
this.Cursor = Cursors.Default;
//MessageBox.Show("导出成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
finally
{
if (isPrint == true)
{
//释放资源
System.Runtime.InteropServices.Marshal.ReleaseComObject(xlSheet);
System.Runtime.InteropServices.Marshal.ReleaseComObject(workbookData);
System.Runtime.InteropServices.Marshal.ReleaseComObject(range);
System.Runtime.InteropServices.Marshal.ReleaseComObject(myExcel);
GC.Collect();
range = null;
xlSheet = null;
workbookData = null;
myExcel = null;
KillAllExcel();
}
}
}
objStreamWriter.WriteLine(strLine);
strLine = "";
private void KillAllExcel()
{
List<Process> excelProcess = GetExcelProcesses();
for (int i = 0; i < excelProcess.Count; i++)
{
excelProcess[i].Kill();
}
objStreamWriter.Close();
objFileStream.Close();
MessageBox.Show("保存EXCEL成功");
}
private List<Process> GetExcelProcesses()
{
Process[] processes = Process.GetProcesses();
List<Process> excelProcesses = new List<Process>();
for (int i = 0; i < processes.Length; i++)
{
if (processes[i].ProcessName.ToUpper() == "EXCEL")
excelProcesses.Add(processes[i]);
}
return excelProcesses;
}
private void tsbStopOperation_Click(object sender, EventArgs e)
{
@ -348,12 +464,13 @@ namespace AIMS.OperationAfter.UI
MessageBox.Show("没有记录请查询到数据后再导出数据到Excel");
return;
}
DataToExcel(dgv);
KillAllExcel();
ExprotExcel2(true);
}
private void dgv_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
Rectangle rectangle = new Rectangle(e.RowBounds.Location.X,
System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(e.RowBounds.Location.X,
e.RowBounds.Location.Y,
dgv.RowHeadersWidth - 4,
e.RowBounds.Height);
@ -363,5 +480,55 @@ namespace AIMS.OperationAfter.UI
dgv.RowHeadersDefaultCellStyle.ForeColor,
TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
}
private void tspSetting_Click(object sender, EventArgs e)
{
frmExportConfig formDataGridViewConfig = new frmExportConfig(dgv, exportConfig, DataGridViewPath, this.Text);
if (formDataGridViewConfig.ShowDialog() == DialogResult.OK)
{
exportConfig = formDataGridViewConfig.exportConfig;
ConfigDataGridView(formDataGridViewConfig.exportConfig);
}
}
public ExportConfig dataGridViewSetting;
private void ConfigDataGridView(SysConfig exportConfig)
{
try
{
dataGridViewSetting = JsonConvert.DeserializeObject<ExportConfig>(exportConfig.Value);
foreach (DataGridViewColumn column in dgv.Columns)
{
foreach (var item in dataGridViewSetting.exports)
{
if (column.Name == "序号" || column.Name == "ApplyId")
{
column.Visible = false;
}
else if (column.Name == item.Name)
{
column.Visible = item.IsVisible;
column.Width = item.Width;
}
}
}
}
catch (Exception ex)
{
PublicMethod.WriteLog(ex);
}
}
private static string GetControlPath(Control control)
{
StringBuilder controlPathStringBuilder = new StringBuilder();
controlPathStringBuilder.Append(control.Name);
while (control.Parent != null)
{
control = control.Parent;
controlPathStringBuilder.Append("." + control.Name);
}
return controlPathStringBuilder.ToString();
}
}
}

View File

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AIMS
{
public class ExportConfig
{
public string Title { get; set; }
public string Path { get; set; }
public int FontSize { get; set; }
public bool Landscape { get; set; }
public List<ExportItem> exports { get; set; }
}
public class ExportItem
{
public string Name { get; set; }
public string Text { get; set; }
public int Width { get; set; }
public bool IsVisible { get; set; }
public bool IsPrint { get; set; }
public int PrintWidth { get; set; }
public int PrintSize { get; set; }
public string PrintName { get; set; }
}
}

Binary file not shown.

View File

@ -15,12 +15,12 @@ namespace AIMSBLL
{
if (ids != null && ids.Length > 0)
{
string sql = string.Format("select * from Charges where IsValid=1 and Id in({0}) order by charindex(','+rtrim(cast(id as varchar(10)))+',',',{0},')", ids);//IsValid=1 and
string sql = string.Format("select *, Bill Stand from Charges where IsValid=1 and Id in({0}) order by charindex(','+rtrim(cast(id as varchar(10)))+',',',{0},')", ids);//IsValid=1 and
return DBHelper.GetDataTable(sql);
}
else
{
string sql = string.Format("select * from Charges where 1<>1 ");
string sql = string.Format("select *, Bill Stand from Charges where 1<>1 ");
return DBHelper.GetDataTable(sql);
}
}
@ -80,11 +80,11 @@ namespace AIMSBLL
string sql = string.Empty;
if (str == "")
{
sql = string.Format("select Top 40 Id ID,name+' '+ISNULL(Bill,'') Name, Code,code xmbm,Form,Price from Charges where Class <> '药品'");
sql = string.Format("select Top 40 Id ID,name+' '+ISNULL(Bill,'') Name, Code,code xmbm,Form,Price,Bill from Charges where Class <> '药品'");
}
else
{
sql = string.Format("select Top 40 Id ID,name+' '+ISNULL(Bill,'') Name, Code,code xmbm,Form,Price from Charges where Class <> '药品' and ( Code like '%{0}%' OR name like '%{0}%' ) ", str);
sql = string.Format("select Top 40 Id ID,name+' '+ISNULL(Bill,'') Name, Code,code xmbm,Form,Price,Bill from Charges where Class <> '药品' and ( Code like '%{0}%' OR name like '%{0}%' ) ", str);
}
try
{

View File

@ -23,11 +23,11 @@ namespace AIMSBLL
string sql = string.Empty;
if (str == "")
{
sql = string.Format("select Id,HelpCode,Name,Id code,Stand,UseDose1,UseDose2,UseDose3,Comment,ZFBL from Drugs where IsValid = 1");
sql = string.Format("select Id,HelpCode,Name,Id code,Stand,UseDose1,UseDose2,UseDose3,Comment,Price,ZFBL from Drugs where IsValid = 1");
}
else
{
sql = string.Format("SELECT Top 26 e.Id,e.Name,Id code, Stand,UseDose1,UseDose2,UseDose3,Comment,ZFBL FROM Drugs e WHERE (Lower(Name) like '%{0}%' OR Lower(HelpCode) like '%{0}%') and IsValid = 1", str);
sql = string.Format("SELECT Top 26 e.Id,e.Name,Id code, Stand,UseDose1,UseDose2,UseDose3,Comment,Price,ZFBL FROM Drugs e WHERE (Lower(Name) like '%{0}%' OR Lower(HelpCode) like '%{0}%') and IsValid = 1", str);
}
return DBHelper.GetDataTable(sql);
}

View File

@ -83,6 +83,7 @@ namespace AIMSBLL
_record.Name = OperationFrontdt.Rows[0]["PatientName"].ToString();
_record.Sex = OperationFrontdt.Rows[0]["Sex"].ToString();
_record.Age = OperationFrontdt.Rows[0]["Age"].ToString();
_record.Identity = OperationFrontdt.Rows[0]["IdentityCard"].ToString();
//_record.Address = OperationFrontdt.Rows[0]["Address"].ToString();
if (OperationFrontdt.Rows[0]["Height"].ToString() != "")
{

View File

@ -21,12 +21,13 @@ namespace AIMSDAL
internal static int Insert(SqlCommand cmd, Drugs drugs)
{
cmd.Parameters.Clear();
cmd.CommandText = "insert into Drugs (Name,HelpCode,DrugKind,Stand,DosageUnit,Unit,UseRate,IsValid,OperatorNo,OperatorName,OperateDate) values (@Name,@HelpCode,@DrugKind,@Stand,@DosageUnit,@Unit,@UseRate,@IsValid,@OperatorNo,@OperatorName,@OperateDate);select @@identity";
cmd.CommandText = "insert into Drugs (Name,HelpCode,DrugKind,Stand,Dosage,DosageUnit,Unit,UseRate,IsValid,OperatorNo,OperatorName,OperateDate) values (@Name,@HelpCode,@DrugKind,@Stand,@Dosage,@DosageUnit,@Unit,@UseRate,@IsValid,@OperatorNo,@OperatorName,@OperateDate);select @@identity";
//从实体中取出值放入Command的参数列表
cmd.Parameters.Add(new SqlParameter("@Name", drugs.Name == null ? (object)DBNull.Value : (object)drugs.Name));
cmd.Parameters.Add(new SqlParameter("@HelpCode", drugs.HelpCode == null ? (object)DBNull.Value : (object)drugs.HelpCode));
cmd.Parameters.Add(new SqlParameter("@DrugKind", drugs.DrugKind == null ? (object)DBNull.Value : (object)drugs.DrugKind));
cmd.Parameters.Add(new SqlParameter("@Stand", drugs.Stand == null ? (object)DBNull.Value : (object)drugs.Stand));
cmd.Parameters.Add(new SqlParameter("@Dosage", drugs.Dosage == null ? (object)DBNull.Value : (object)drugs.Dosage));
cmd.Parameters.Add(new SqlParameter("@DosageUnit", drugs.DosageUnit == null ? (object)DBNull.Value : (object)drugs.DosageUnit));
cmd.Parameters.Add(new SqlParameter("@Unit", drugs.Unit == null ? (object)DBNull.Value : (object)drugs.Unit));
cmd.Parameters.Add(new SqlParameter("@UseRate", drugs.UseRate.HasValue ? (object)drugs.UseRate.Value : (object)DBNull.Value));
@ -178,12 +179,13 @@ namespace AIMSDAL
/// <returns>影响的记录行数</returns>
internal static int ExcuteUpdateCommand(SqlCommand cmd, Drugs drugs)
{
cmd.CommandText = "update Drugs set Name=@Name,HelpCode=@HelpCode,DrugKind=@DrugKind,Stand=@Stand,DosageUnit=@DosageUnit,Unit=@Unit,UseRate=@UseRate,IsValid=@IsValid,OperatorNo=@OperatorNo,OperatorName=@OperatorName,OperateDate=@OperateDate,Remark=@Remark,Channel=@Channel,UseDose1=@UseDose1,UseDose2=@UseDose2,UseDose3=@UseDose3,Comment=@Comment,ZFBL=@ZFBL where Id=@Id";
cmd.CommandText = "update Drugs set Name=@Name,HelpCode=@HelpCode,DrugKind=@DrugKind,Stand=@Stand,Dosage=@Dosage,DosageUnit=@DosageUnit,Unit=@Unit,UseRate=@UseRate,IsValid=@IsValid,OperatorNo=@OperatorNo,OperatorName=@OperatorName,OperateDate=@OperateDate,Remark=@Remark,Channel=@Channel,UseDose1=@UseDose1,UseDose2=@UseDose2,UseDose3=@UseDose3,Comment=@Comment,ZFBL=@ZFBL where Id=@Id";
//从实体中取出值放入Command的参数列表
cmd.Parameters.Add(new SqlParameter("@Name", drugs.Name == null ? (object)DBNull.Value : (object)drugs.Name));
cmd.Parameters.Add(new SqlParameter("@HelpCode", drugs.HelpCode == null ? (object)DBNull.Value : (object)drugs.HelpCode));
cmd.Parameters.Add(new SqlParameter("@DrugKind", drugs.DrugKind == null ? (object)DBNull.Value : (object)drugs.DrugKind));
cmd.Parameters.Add(new SqlParameter("@Stand", drugs.Stand == null ? (object)DBNull.Value : (object)drugs.Stand));
cmd.Parameters.Add(new SqlParameter("@Dosage", drugs.Dosage == null ? (object)DBNull.Value : (object)drugs.Dosage));
cmd.Parameters.Add(new SqlParameter("@DosageUnit", drugs.DosageUnit == null ? (object)DBNull.Value : (object)drugs.DosageUnit));
cmd.Parameters.Add(new SqlParameter("@Unit", drugs.Unit == null ? (object)DBNull.Value : (object)drugs.Unit));
cmd.Parameters.Add(new SqlParameter("@UseRate", drugs.UseRate.HasValue ? (object)drugs.UseRate.Value : (object)DBNull.Value));
@ -618,6 +620,10 @@ namespace AIMSDAL
{
entity.Stand = dr["Stand"].ToString();
}
if (dr["Dosage"] != System.DBNull.Value)
{
entity.Dosage = dr["Dosage"].ToString();
}
if (dr["DosageUnit"] != System.DBNull.Value)
{
entity.DosageUnit = dr["DosageUnit"].ToString();
@ -682,10 +688,6 @@ namespace AIMSDAL
{
entity.Code = dr["Code"].ToString();
}
if (dr["Dosage"] != System.DBNull.Value)
{
entity.Dosage = dr["Dosage"].ToString();
}
return entity;
}
}

View File

@ -15,13 +15,14 @@ namespace AIMSDAL
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into [Drugs](");
strSql.Append("Name,HelpCode,DrugKind,Stand,DosageUnit,Unit,UseRate,IsValid,OperatorNo,OperatorName,OperateDate,Remark,Channel,UseDose1,UseDose2,UseDose3,Comment,ZFBL ");
strSql.Append("Name,HelpCode,DrugKind,Stand,Dosage,DosageUnit,Unit,UseRate,IsValid,OperatorNo,OperatorName,OperateDate,Remark,Channel,UseDose1,UseDose2,UseDose3,Comment,ZFBL ");
strSql.Append(")");
strSql.Append(" values (");
strSql.Append("'" + DrugsObj.Name + "',");
strSql.Append("'" + DrugsObj.HelpCode + "',");
strSql.Append("'" + DrugsObj.DrugKind + "',");
strSql.Append("'" + DrugsObj.Stand + "',");
strSql.Append("'" + DrugsObj.Dosage + "',");
strSql.Append("'" + DrugsObj.DosageUnit + "',");
strSql.Append("'" + DrugsObj.Unit + "',");
strSql.Append("" + DrugsObj.UseRate + ",");
@ -46,7 +47,7 @@ namespace AIMSDAL
Drugs DrugsObj = new Drugs();
StringBuilder strSql = new StringBuilder();
strSql.Append("select ");
strSql.Append("Id,Name,HelpCode,DrugKind,Stand,DosageUnit,Unit,UseRate,IsValid,OperatorNo,OperatorName,OperateDate,Code,Remark,Channel,UseDose1,UseDose2,UseDose3,Comment,ZFBL ");
strSql.Append("Id,Name,HelpCode,DrugKind,Stand,Dosage,DosageUnit,Unit,UseRate,IsValid,OperatorNo,OperatorName,OperateDate,Code,Remark,Channel,UseDose1,UseDose2,UseDose3,Comment,ZFBL ");
strSql.Append(" from Drugs ");
strSql.Append(" where Id=" + Id + "");
DataSet ds = HelperDB.DbHelperSQL.GetDataSet(strSql.ToString());
@ -60,6 +61,7 @@ namespace AIMSDAL
DrugsObj.HelpCode = ds.Tables[0].Rows[0]["HelpCode"].ToString();
DrugsObj.DrugKind = ds.Tables[0].Rows[0]["DrugKind"].ToString();
DrugsObj.Stand = ds.Tables[0].Rows[0]["Stand"].ToString();
DrugsObj.Dosage = ds.Tables[0].Rows[0]["Dosage"].ToString();
DrugsObj.DosageUnit = ds.Tables[0].Rows[0]["DosageUnit"].ToString();
DrugsObj.Unit = ds.Tables[0].Rows[0]["Unit"].ToString();
if (ds.Tables[0].Rows[0]["UseRate"].ToString() != "")
@ -91,7 +93,7 @@ namespace AIMSDAL
public static DataTable GetDataTable(string DrugKind)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select [Id],[Name],[HelpCode],[DrugKind],[Stand],[DosageUnit],[Unit],CASE IsValid WHEN 1 THEN '有效' WHEN 0 THEN '无效' END AS IsValid,UseRate,Code,Remark,Channel,UseDose1,UseDose2,UseDose3,Comment,ZFBL");
strSql.Append("select [Id],[Name],[HelpCode],[DrugKind],[Stand],[Dosage],[DosageUnit],[Unit],CASE IsValid WHEN 1 THEN '有效' WHEN 0 THEN '无效' END AS IsValid,UseRate,Code,Remark,Channel,UseDose1,UseDose2,UseDose3,Comment,ZFBL");
strSql.Append(" FROM Drugs where DrugKind like '%" + DrugKind + "%'");
return HelperDB.DbHelperSQL.GetDataTable(strSql.ToString());
@ -99,7 +101,7 @@ namespace AIMSDAL
public static DataTable GetDataTable(string DrugKind, string Name)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select [Id],[Name],[HelpCode],[DrugKind],[Stand],[DosageUnit],[Unit],CASE IsValid WHEN 1 THEN '有效' WHEN 0 THEN '无效' END AS IsValid,UseRate,Code,Remark,Channel,UseDose1,UseDose2,UseDose3,Comment,ZFBL");
strSql.Append("select [Id],[Name],[HelpCode],[DrugKind],[Stand],[Dosage],[DosageUnit],[Unit],CASE IsValid WHEN 1 THEN '有效' WHEN 0 THEN '无效' END AS IsValid,UseRate,Code,Remark,Channel,UseDose1,UseDose2,UseDose3,Comment,ZFBL");
strSql.Append(" FROM Drugs where DrugKind like '%" + DrugKind + "%' " + (Name == "" ? "" : "and (NAME LIKE '%" + Name + "%' OR HelpCode LIKE '%" + Name + "%') "));
return HelperDB.DbHelperSQL.GetDataTable(strSql.ToString());
@ -112,17 +114,10 @@ namespace AIMSDAL
return HelperDB.DbHelperSQL.GetDataTable(strSql.ToString());
}
public static DataTable GetDataTableByHelpCode(string HelpCode)
{
string strSql = "SELECT Id,Name,Stand,DosageUnit,UseDose1,UseDose2,UseDose3,Comment,ZFBL FROM dbo.Drugs WHERE (NAME LIKE '%" + HelpCode + "%' OR HelpCode LIKE '%" + HelpCode + "%')";
return HelperDB.DbHelperSQL.GetDataTable(strSql.ToString());
}
public static DataTable GetDrugsDataTable()
{
string strSql = "SELECT TOP 21 e.Id, e.Name,e.Stand,e.UseDose1,e.UseDose2,e.UseDose3,Comment,ZFBL FROM Drugs e WHERE e.IsValid=1 ORDER BY e.UseRate DESC ";
return HelperDB.DbHelperSQL.GetDataTable(strSql);
}
}
}

View File

@ -240,7 +240,7 @@ namespace AIMSDAL
public static DataTable GetOperationFrontDataTableByPatientId(int PatientId)
{
string strSql = "SELECT of1.ApplyId, of1.MdrecNo, of1.ArchivesNo, of1.PatientName,of1.DepartmentId,of1.PatientDepName,of1.ApplyDepName, of1.PatientKind," +
"of1.Sex, of1.Age,of1.BirthDay, of1.Height, of1.[Weight], of1.BloodType," +
"of1.Sex, of1.Age,of1.BirthDay, of1.Height, of1.[Weight], of1.BloodType,of1.IdentityCard," +
"of1.RHBloodType, of1.Illdistrict, of1.SickBed, of1.OperationType," +
"of1.OrderOperationTime, of1.OperationTimeLeight, of1.[State],of1.StateId," +
"of1.IsReturnOperation, of1.IsPlanReturnOperation, of1.ApplyDiagnoseInfoName," +

View File

@ -6,6 +6,7 @@ using System.Data;
using AIMSModel;
using DrawGraph;
using AIMSDAL;
using AIMSExtension;
namespace AIMSBLL
{
@ -56,7 +57,7 @@ namespace AIMSBLL
string strSql = "SELECT of2.Id,of1.PatientId, of1.ApplyId, of1.ApplyDepName, of1.OperationType, of1.MdrecNo, of1.PatientName, of2.OperationInfoNames ApplyOperationInfoName, of2.OperationDoctor, of2.AnesthesiaDoctor,of2.OperationRoomId,of2.State ,of1.Sex,Age,of2.OutRoomTime ,of2.Nurse InstrumentNurse,of2.Nurse2 TourNurse,of2.DiagnoseInfoName ApplyDiagnoseInfoName ,of2.OperationRoom,of2.Whereabouts FROM V_OperationDoing of2 left join[dbo].[V_OperationFront] of1 on of1.PatientId = of2.PatientId WHERE of1.State in( '手术结束') and of2.Pulse='恢复室' and of2.OutRoomTime >= '" + BeginDate + "' AND of2.OutRoomTime<'" + BeginDate.AddDays(1) + "' and RecoverId=1 and of2.Id not in (select iD from OperationRecord where RecoverId<>1)";
return HelperDB.DbHelperSQL.GetDataTable(strSql.ToString());
}
public static DataTable GetRecoverPatientOutDataTable(DateTime BeginDate,DateTime EndDate)
public static DataTable GetRecoverPatientOutDataTable(DateTime BeginDate, DateTime EndDate)
{
string strSql = "SELECT of2.Id,of1.PatientId, of1.ApplyId, of1.ApplyDepName, of1.OperationType, of1.MdrecNo, of1.PatientName, of2.OperationInfoNames ApplyOperationInfoName, of2.OperationDoctor, of2.AnesthesiaDoctor,of2.OperationRoomId,of2.State ,of1.Sex,Age,of2.OutRoomTime ,of2.Nurse InstrumentNurse,of2.Nurse2 TourNurse,of2.DiagnoseInfoName ApplyDiagnoseInfoName ,of2.OperationRoom FROM V_OperationDoing of2 left join[dbo].[V_OperationFront] of1 on of1.PatientId = of2.PatientId WHERE of1.State in( '麻醉恢复结束') and of2.OutRoomTime >= '" + BeginDate + "' AND of2.OutRoomTime<'" + EndDate + "' and RecoverId=2 order by OutRoomTime desc ";
return HelperDB.DbHelperSQL.GetDataTable(strSql.ToString());
@ -197,7 +198,7 @@ namespace AIMSBLL
FactPersonDuty FactPersonDutyObj = new FactPersonDuty();
FactPersonDutyObj.PatientId = PatientId;
FactPersonDutyObj.ApplyId = ApplyId;
FactPersonDutyObj.PersonDutyId = int.Parse(dt.Rows[i]["PersonDutyId"].ToString()) ;
FactPersonDutyObj.PersonDutyId = int.Parse(dt.Rows[i]["PersonDutyId"].ToString());
FactPersonDutyObj.PersonId = int.Parse(dt.Rows[i]["PersonId"].ToString());
FactPersonDutyObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
FactPersonDutyObj.OperatorName = AIMSExtension.PublicMethod.OperatorName;
@ -221,6 +222,18 @@ namespace AIMSBLL
}
}
if (PublicMethod.GetHospitalName().Contains("金州"))
{
FactPersonDuty FactPersonDutyObj = new FactPersonDuty();
FactPersonDutyObj.PatientId = PatientId;
FactPersonDutyObj.ApplyId = ApplyId;
FactPersonDutyObj.PersonDutyId = 11;
FactPersonDutyObj.PersonId = 6805;
FactPersonDutyObj.OperatorNo = AIMSExtension.PublicMethod.OperatorNo;
FactPersonDutyObj.OperatorName = AIMSExtension.PublicMethod.OperatorName;
FactPersonDutyObj.OperateDate = AIMSExtension.PublicMethod.SystemDate();
BFactPersonDuty.Add(FactPersonDutyObj);
}
//增加入室事件
Events EventsObj = BEvents.GetModelByName("入室");

View File

@ -84,7 +84,7 @@ namespace GoldPrinter
public PrinterPageSetting(PrintDocument printDocument)
{
string text = ConfigurationSettings.AppSettings["PrintMode"];
string text = "";// ConfigurationSettings.AppSettings["PrintMode"];
if (text == null)
{
text = "Win";