?? serviceinfo.cs
字號:
//
// label8
//
this.label8.Location = new System.Drawing.Point(584, 24);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(56, 16);
this.label8.TabIndex = 39;
this.label8.Text = "費用分類";
//
// txt7
//
this.txt7.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "門診收費項目.費用"));
this.txt7.Location = new System.Drawing.Point(384, 40);
this.txt7.Name = "txt7";
this.txt7.ReadOnly = true;
this.txt7.Size = new System.Drawing.Size(80, 21);
this.txt7.TabIndex = 45;
this.txt7.Text = "";
//
// label10
//
this.label10.Location = new System.Drawing.Point(384, 24);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(56, 16);
this.label10.TabIndex = 36;
this.label10.Text = "費用";
//
// txt6
//
this.txt6.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "門診收費項目.拼音碼"));
this.txt6.Location = new System.Drawing.Point(280, 38);
this.txt6.Name = "txt6";
this.txt6.ReadOnly = true;
this.txt6.Size = new System.Drawing.Size(80, 21);
this.txt6.TabIndex = 46;
this.txt6.Text = "";
//
// label15
//
this.label15.Location = new System.Drawing.Point(280, 22);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(88, 16);
this.label15.TabIndex = 41;
this.label15.Text = "拼音碼";
//
// txt8
//
this.txt8.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "門診收費項目.病種分類"));
this.txt8.Location = new System.Drawing.Point(488, 40);
this.txt8.Name = "txt8";
this.txt8.ReadOnly = true;
this.txt8.Size = new System.Drawing.Size(80, 21);
this.txt8.TabIndex = 44;
this.txt8.Text = "";
//
// label18
//
this.label18.Location = new System.Drawing.Point(488, 24);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(72, 16);
this.label18.TabIndex = 37;
this.label18.Text = "病種分類";
//
// label6
//
this.label6.Location = new System.Drawing.Point(24, 72);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(56, 16);
this.label6.TabIndex = 38;
this.label6.Text = "備注";
//
// txt9
//
this.txt9.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11, "門診收費項目.備注"));
this.txt9.Location = new System.Drawing.Point(24, 88);
this.txt9.Name = "txt9";
this.txt9.ReadOnly = true;
this.txt9.Size = new System.Drawing.Size(680, 21);
this.txt9.TabIndex = 42;
this.txt9.Text = "";
//
// 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=localhost;packet size=4096;integrated security=SSPI;data source=\"." +
"\";persist security info=False;initial catalog=hisbook";
//
// 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(728, 502);
this.Name = "ServiceInfo";
this.Text = "【收費項目】";
this.Load += new System.EventHandler(this.ServiceInfo_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.groupBox2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
} #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;//基類中有一個dataSet11和cmOrders相連
}
//-------------根據輸入,檢索信息-----------------
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);
}
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 + -