如题,下面是代码,我试了很多次了,不管什么情况下,它都是灰色的,基本上没有判断的作用。请指教啊~~~~~~~
//通过病人ID查找出该病人的电子病历信息
private void button5_Click(object sender, EventArgs e)
{
if (textBox8.Text.Trim() == "")
{
MessageBox.Show("请输入需要查询的病人ID!", "提示");
return;
}
else
{
try
{
RefreshData1();//显示病人信息
RefreshData2();//显示电子病历内容
}
catch (Exception ex)
{
//SQL.cn.Close();
MessageBox.Show(ex.Message);
}
}
string sconnStr = "server=.;database=project;Integrated Security=true";
SqlConnection con = new SqlConnection(sconnStr);
string cmd = "select qrqm from DZBL where brid='" + textBox8.Text.Trim() + "'";
SqlCommand comd = new SqlCommand(cmd,con);
con.Open();
SqlDataReader myDR = comd.ExecuteReader();
while (myDR.Read())
{
if (myDR["qrqm"] != System.DBNull.Value)
{
this.button3修改.Enabled = false;
label53.Text = "该病历已经签名确认,不能再作修改";
}
else if (myDR["qrqm"] != null)
{
this.button3修改.Enabled = false;
label53.Text = "该病历已经签名确认,不能再作修改";
}
else
{
this.button3修改.Enabled = true;
}
}
//string QRQM = "select qrqm from DZBL where brid='" + textBox8.Text.Trim() + "'";
//if (QRQM == "")
//{ this.button3修改.Enabled = false;
// label53.Text = "该病历已经签名确认,不能再作修改";
//}
//else
//{
// this.button3修改.Enabled = false;
//}
//label53.Text = "该病历已经签名确认,不能再作修改";
textBox8.Text = "";
}
