📄 serviceinfo.cs
字号:
this.label15.TabIndex = 54;
this.label15.Text = "拼音码";
//
// txt8
//
this.txt8.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "门诊收费项目.病种分类"));
this.txt8.Location = new System.Drawing.Point(488, 336);
this.txt8.Name = "txt8";
this.txt8.ReadOnly = true;
this.txt8.Size = new System.Drawing.Size(80, 21);
this.txt8.TabIndex = 58;
this.txt8.Text = "";
//
// label18
//
this.label18.Location = new System.Drawing.Point(488, 320);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(72, 16);
this.label18.TabIndex = 49;
this.label18.Text = "病种分类";
//
// label6
//
this.label6.Location = new System.Drawing.Point(24, 368);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(56, 16);
this.label6.TabIndex = 51;
this.label6.Text = "备注";
//
// txt9
//
this.txt9.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "门诊收费项目.备注"));
this.txt9.Location = new System.Drawing.Point(24, 384);
this.txt9.Name = "txt9";
this.txt9.ReadOnly = true;
this.txt9.Size = new System.Drawing.Size(680, 21);
this.txt9.TabIndex = 55;
this.txt9.Text = "";
//
// dataSet11
//
this.dataSet11.DataSetName = "DataSet1";
this.dataSet11.Locale = new System.Globalization.CultureInfo("en-US");
//
// sqlSelectCommand1
//
this.sqlSelectCommand1.CommandText = "SELECT 编号, 名称, 拼音码, 费用, 费用分类, 病种分类, 备注 FROM 门诊收费项目 WHERE (拼音码 LIKE @Param4 OR 拼音码" +
" IS NULL) AND (名称 LIKE @Param5) AND (编号 LIKE @Param6)";
this.sqlSelectCommand1.Connection = this.sqlConnection1;
this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Param4", System.Data.SqlDbType.VarChar, 100, "拼音码"));
this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Param5", System.Data.SqlDbType.VarChar, 100, "名称"));
this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Param6", System.Data.SqlDbType.VarChar, 20, "编号"));
//
// sqlConnection1
//
this.sqlConnection1.ConnectionString = "workstation id=BRIGHT;packet size=4096;user id=sa;data source=BRIGHT;persist secu" +
"rity info=False;initial catalog=hospitalms";
//
// sqlInsertCommand1
//
this.sqlInsertCommand1.CommandText = "INSERT INTO 门诊收费项目(编号, 名称, 拼音码, 费用, 费用分类, 病种分类, 备注) VALUES (@编号, @名称, @拼音码, @费用, " +
"@费用分类, @病种分类, @备注); SELECT 编号, 名称, 拼音码, 费用, 费用分类, 病种分类, 备注 FROM 门诊收费项目 WHERE (编号" +
" = @编号)";
this.sqlInsertCommand1.Connection = this.sqlConnection1;
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@编号", System.Data.SqlDbType.VarChar, 20, "编号"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@名称", System.Data.SqlDbType.VarChar, 100, "名称"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@拼音码", System.Data.SqlDbType.VarChar, 100, "拼音码"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@费用", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(12)), ((System.Byte)(2)), "费用", System.Data.DataRowVersion.Current, null));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@费用分类", System.Data.SqlDbType.VarChar, 100, "费用分类"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@病种分类", System.Data.SqlDbType.VarChar, 100, "病种分类"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@备注", System.Data.SqlDbType.VarChar, 100, "备注"));
//
// sqlUpdateCommand1
//
this.sqlUpdateCommand1.CommandText = @"UPDATE 门诊收费项目 SET 编号 = @编号, 名称 = @名称, 拼音码 = @拼音码, 费用 = @费用, 费用分类 = @费用分类, 病种分类 = @病种分类, 备注 = @备注 WHERE (编号 = @Original_编号) AND (名称 = @Original_名称 OR @Original_名称 IS NULL AND 名称 IS NULL) AND (备注 = @Original_备注 OR @Original_备注 IS NULL AND 备注 IS NULL) AND (拼音码 = @Original_拼音码 OR @Original_拼音码 IS NULL AND 拼音码 IS NULL) AND (病种分类 = @Original_病种分类 OR @Original_病种分类 IS NULL AND 病种分类 IS NULL) AND (费用 = @Original_费用 OR @Original_费用 IS NULL AND 费用 IS NULL) AND (费用分类 = @Original_费用分类 OR @Original_费用分类 IS NULL AND 费用分类 IS NULL); SELECT 编号, 名称, 拼音码, 费用, 费用分类, 病种分类, 备注 FROM 门诊收费项目 WHERE (编号 = @编号)";
this.sqlUpdateCommand1.Connection = this.sqlConnection1;
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@编号", System.Data.SqlDbType.VarChar, 20, "编号"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@名称", System.Data.SqlDbType.VarChar, 100, "名称"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@拼音码", System.Data.SqlDbType.VarChar, 100, "拼音码"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@费用", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(12)), ((System.Byte)(2)), "费用", System.Data.DataRowVersion.Current, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@费用分类", System.Data.SqlDbType.VarChar, 100, "费用分类"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@病种分类", System.Data.SqlDbType.VarChar, 100, "病种分类"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@备注", System.Data.SqlDbType.VarChar, 100, "备注"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_编号", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "编号", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_名称", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "名称", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_备注", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "备注", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_拼音码", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "拼音码", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_病种分类", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "病种分类", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_费用", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(12)), ((System.Byte)(2)), "费用", System.Data.DataRowVersion.Original, null));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_费用分类", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "费用分类", System.Data.DataRowVersion.Original, null));
//
// sqlDeleteCommand1
//
this.sqlDeleteCommand1.CommandText = @"DELETE FROM 门诊收费项目 WHERE (编号 = @Original_编号) AND (名称 = @Original_名称 OR @Original_名称 IS NULL AND 名称 IS NULL) AND (备注 = @Original_备注 OR @Original_备注 IS NULL AND 备注 IS NULL) AND (拼音码 = @Original_拼音码 OR @Original_拼音码 IS NULL AND 拼音码 IS NULL) AND (病种分类 = @Original_病种分类 OR @Original_病种分类 IS NULL AND 病种分类 IS NULL) AND (费用 = @Original_费用 OR @Original_费用 IS NULL AND 费用 IS NULL) AND (费用分类 = @Original_费用分类 OR @Original_费用分类 IS NULL AND 费用分类 IS NULL)";
this.sqlDeleteCommand1.Connection = this.sqlConnection1;
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_编号", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "编号", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_名称", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "名称", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_备注", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "备注", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_拼音码", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "拼音码", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_病种分类", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "病种分类", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_费用", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(12)), ((System.Byte)(2)), "费用", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_费用分类", System.Data.SqlDbType.VarChar, 100, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "费用分类", System.Data.DataRowVersion.Original, null));
//
// ServiceInfo
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(888, 424);
this.Controls.Add(this.cmb1);
this.Controls.Add(this.label4);
this.Controls.Add(this.txt4);
this.Controls.Add(this.txt5);
this.Controls.Add(this.label5);
this.Controls.Add(this.label8);
this.Controls.Add(this.txt7);
this.Controls.Add(this.label10);
this.Controls.Add(this.txt6);
this.Controls.Add(this.label15);
this.Controls.Add(this.txt8);
this.Controls.Add(this.label18);
this.Controls.Add(this.label6);
this.Controls.Add(this.txt9);
this.Name = "ServiceInfo";
this.Text = "【收费项目】";
this.Load += new System.EventHandler(this.ServiceInfo_Load);
this.Controls.SetChildIndex(this.toolBar1, 0);
this.Controls.SetChildIndex(this.label3, 0);
this.Controls.SetChildIndex(this.txt3, 0);
this.Controls.SetChildIndex(this.label2, 0);
this.Controls.SetChildIndex(this.txt1, 0);
this.Controls.SetChildIndex(this.label1, 0);
this.Controls.SetChildIndex(this.txt2, 0);
this.Controls.SetChildIndex(this.btnSearch, 0);
this.Controls.SetChildIndex(this.dataGrid1, 0);
this.Controls.SetChildIndex(this.txt9, 0);
this.Controls.SetChildIndex(this.label6, 0);
this.Controls.SetChildIndex(this.label18, 0);
this.Controls.SetChildIndex(this.txt8, 0);
this.Controls.SetChildIndex(this.label15, 0);
this.Controls.SetChildIndex(this.txt6, 0);
this.Controls.SetChildIndex(this.label10, 0);
this.Controls.SetChildIndex(this.txt7, 0);
this.Controls.SetChildIndex(this.label8, 0);
this.Controls.SetChildIndex(this.label5, 0);
this.Controls.SetChildIndex(this.txt5, 0);
this.Controls.SetChildIndex(this.txt4, 0);
this.Controls.SetChildIndex(this.label4, 0);
this.Controls.SetChildIndex(this.cmb1, 0);
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
this.ResumeLayout(false);
} #endregion
private void ServiceInfo_Load(object sender, System.EventArgs e)
{
da1.SelectCommand.Parameters[0].Value="%%";
da1.SelectCommand.Parameters[1].Value="%%";
da1.SelectCommand.Parameters[2].Value="%%";
da1.Fill(dataSet11);
this.cmOrders=(CurrencyManager) BindingContext[dataSet11,"门诊收费项目"];
base.dataSet11=this.dataSet11;
}
private void btnSearch_Click(object sender, System.EventArgs e)
{
da1.SelectCommand.Parameters[0].Value="%%";
da1.SelectCommand.Parameters[1].Value="%%";
da1.SelectCommand.Parameters[2].Value="%%";
if(txt1.Text!="")
{
da1.SelectCommand.Parameters[0].Value="%"+txt1.Text+"%";
}
if(txt2.Text!="")
{
da1.SelectCommand.Parameters[1].Value="%"+txt2.Text+"%";
}
if(txt3.Text!="")
{
da1.SelectCommand.Parameters[2].Value="%"+txt3.Text+"%";
}
dataSet11.门诊收费项目.Clear();
da1.Fill(dataSet11);
base.dataSet11=this.dataSet11;
} protected override bool CheckNotNull()
{
if(txt4.Text.Trim()=="")
{
MessageBox.Show("医疗收费项目编号不能为空,请输入编号","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
return(false);
}
if(txt5.Text.Trim()=="")
{
MessageBox.Show("医疗收费项目名称不能为空,请输入名称","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
return(false);
}
try
{
string strConn="workstation id=localhost;Integrated Security=SSPI;Database=hospitalms;";
SqlConnection cn=new SqlConnection(strConn);
cn.Open();
SqlCommand cmd=cn.CreateCommand();
cmd.CommandText="select * from 门诊收费项目 where 编号='"+txt4.Text+"'";
SqlDataReader dr=cmd.ExecuteReader();
while(dr.Read())
{
MessageBox.Show("收费编号已经存在","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
return(false);
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
return(base.CheckNotNull());
}
protected override void SetModifyMode(bool blnEdit)
{
base.SetModifyMode (blnEdit);
txt4.ReadOnly=!blnEdit;
txt5.ReadOnly=!blnEdit;
txt6.ReadOnly=!blnEdit;
txt7.ReadOnly=!blnEdit;
txt8.ReadOnly=!blnEdit;
txt9.ReadOnly=!blnEdit;
cmb1.Enabled=blnEdit;
}
}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -