public bool add听诊人设置(听诊模拟人 _听诊模拟人, string user_name) { return simulationDao.add听诊人设置(_听诊模拟人, user_name); }
public 听诊模拟人 get听诊人设置(string user_name) { StringBuilder strSql = new StringBuilder(); strSql.Append(" select "); strSql.Append(" 心前区震颤,心尖搏动, 二尖瓣听诊区,肺动脉瓣听诊区, "); strSql.Append(" 主动脉瓣区,主动脉瓣第二听诊区,三尖瓣区,气管,左肺上,左肺中,左肺下, "); strSql.Append(" 右肺上,右肺中,右肺下 "); strSql.Append(" from tcz_tzmnr "); strSql.Append(" where "); strSql.Append(" LOGIN_ID = ?LOGIN_ID "); MySqlParameter[] parameters = { new MySqlParameter("?LOGIN_ID", MySqlDbType.VarChar) }; parameters[0].Value = user_name; DataSet ds = MySqlHelper.DateSet(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count == 1) { 听诊模拟人 _听诊模拟人 = new 听诊模拟人(); _听诊模拟人.心前区震颤 = Convert.ToString(ds.Tables[0].Rows[0]["心前区震颤"].ToString()); _听诊模拟人.心尖搏动 = Convert.ToString(ds.Tables[0].Rows[0]["心尖搏动"].ToString()); _听诊模拟人.二尖瓣听诊区 = Convert.ToString(ds.Tables[0].Rows[0]["二尖瓣听诊区"].ToString()); _听诊模拟人.肺动脉瓣听诊区 = Convert.ToString(ds.Tables[0].Rows[0]["肺动脉瓣听诊区"].ToString()); _听诊模拟人.主动脉瓣第二听诊区 = Convert.ToString(ds.Tables[0].Rows[0]["主动脉瓣第二听诊区"].ToString()); _听诊模拟人.三尖瓣区 = Convert.ToString(ds.Tables[0].Rows[0]["三尖瓣区"].ToString()); _听诊模拟人.气管 = Convert.ToString(ds.Tables[0].Rows[0]["气管"].ToString()); _听诊模拟人.左肺上 = Convert.ToString(ds.Tables[0].Rows[0]["左肺上"].ToString()); _听诊模拟人.左肺中 = Convert.ToString(ds.Tables[0].Rows[0]["左肺中"].ToString()); _听诊模拟人.左肺下 = Convert.ToString(ds.Tables[0].Rows[0]["左肺下"].ToString()); _听诊模拟人.右肺上 = Convert.ToString(ds.Tables[0].Rows[0]["右肺上"].ToString()); _听诊模拟人.右肺中 = Convert.ToString(ds.Tables[0].Rows[0]["右肺中"].ToString()); _听诊模拟人.右肺下 = Convert.ToString(ds.Tables[0].Rows[0]["右肺下"].ToString()); return _听诊模拟人; } return null; }
public bool add听诊人设置(听诊模拟人 _听诊模拟人, string user_name) { //检索是否存在该用户的信息 StringBuilder strSql = new StringBuilder(); //先检查是否有旧记录没有正确退出 strSql.Append(" select count(1) from tcz_tzmnr "); strSql.Append(" where "); strSql.Append(" LOGIN_ID=?LOGIN_ID "); MySqlParameter[] parameters0 = { new MySqlParameter("?LOGIN_ID", MySqlDbType.VarChar) }; parameters0[0].Value = user_name; int row0 = Convert.ToInt32(MySqlHelper.ExecuteScalar(strSql.ToString(), parameters0)); if (row0 > 0)//存在更新 { strSql = new StringBuilder(); strSql.Append(" update tcz_tzmnr set 心前区震颤='" + _听诊模拟人.心前区震颤 + "', "); strSql.Append(" 心尖搏动='" + _听诊模拟人.心尖搏动 + "', "); strSql.Append(" 二尖瓣听诊区='" + _听诊模拟人.二尖瓣听诊区 + "', "); strSql.Append(" 肺动脉瓣听诊区='" + _听诊模拟人.肺动脉瓣听诊区 + "', "); strSql.Append(" 主动脉瓣区='" + _听诊模拟人.主动脉瓣区 + "', "); strSql.Append(" 主动脉瓣第二听诊区='" + _听诊模拟人.主动脉瓣第二听诊区 + "', "); strSql.Append(" 三尖瓣区='" + _听诊模拟人.三尖瓣区 + "', "); strSql.Append(" 气管='" + _听诊模拟人.气管 + "', "); strSql.Append(" 左肺上='" + _听诊模拟人.左肺上 + "', "); strSql.Append(" 左肺中='" + _听诊模拟人.左肺中 + "', "); strSql.Append(" 左肺下='" + _听诊模拟人.左肺下 + "', "); strSql.Append(" 右肺上='" + _听诊模拟人.右肺上 + "', "); strSql.Append(" 右肺中='" + _听诊模拟人.右肺中 + "', "); strSql.Append(" 右肺下='" + _听诊模拟人.右肺下 + "' "); strSql.Append(" where "); strSql.Append(" LOGIN_ID=?LOGIN_ID "); MySqlParameter[] parameters1 = { new MySqlParameter("?LOGIN_ID", MySqlDbType.VarChar) }; parameters1[0].Value = user_name; int rows1 = MySqlHelper.ExecuteNonQuery(strSql.ToString(), parameters1); if (rows1 > 0) { return true; } else { return false; } } else//不存在新增 { strSql = new StringBuilder(); strSql.Append(" insert into tcz_tzmnr ( LOGIN_ID,"); strSql.Append(" 心前区震颤,心尖搏动, 二尖瓣听诊区,肺动脉瓣听诊区, "); strSql.Append(" 主动脉瓣区,主动脉瓣第二听诊区,三尖瓣区,气管,左肺上,左肺中,左肺下, "); strSql.Append(" 右肺上,右肺中,右肺下 "); strSql.Append(" ) values ( ?LOGIN_ID, "); strSql.Append(" '" + _听诊模拟人.心前区震颤 + "', "); strSql.Append(" '" + _听诊模拟人.心尖搏动 + "', "); strSql.Append(" '" + _听诊模拟人.二尖瓣听诊区 + "', "); strSql.Append(" '" + _听诊模拟人.肺动脉瓣听诊区 + "', "); strSql.Append(" '" + _听诊模拟人.主动脉瓣区 + "', "); strSql.Append(" '" + _听诊模拟人.主动脉瓣第二听诊区 + "', "); strSql.Append(" '" + _听诊模拟人.三尖瓣区 + "', "); strSql.Append(" '" + _听诊模拟人.气管 + "', "); strSql.Append(" '" + _听诊模拟人.左肺上 + "', "); strSql.Append(" '" + _听诊模拟人.左肺中 + "', "); strSql.Append(" '" + _听诊模拟人.左肺下 + "', "); strSql.Append(" '" + _听诊模拟人.右肺上 + "', "); strSql.Append(" '" + _听诊模拟人.右肺中 + "', "); strSql.Append(" '" + _听诊模拟人.右肺下 + "' "); strSql.Append(" ) "); MySqlParameter[] parameters = { new MySqlParameter("?LOGIN_ID", MySqlDbType.VarChar) }; parameters[0].Value = user_name; int rows = MySqlHelper.ExecuteNonQuery(strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } } }
private void sendCzSettings(听诊模拟人 _听诊模拟人) { if (!LoginRoler.Tzmonitors.ContainsKey("tzmnr1")) return; if (!LoginRoler.Tzmonitors.ContainsKey("tzmnr2")) return; SerialPort BluetoothConnection1 = LoginRoler.Tzmonitors["tzmnr1"]; SerialPort BluetoothConnection2 = LoginRoler.Tzmonitors["tzmnr2"]; //心前区震颤 if (_听诊模拟人.心前区震颤=="1") { BluetoothUtil.BlueToothDataSend(BluetoothConnection1, ((AgreeMent)LoginRoler.AgreeMents[Constant.心前区震颤有]).Agreement ); } else if (_听诊模拟人.心前区震颤 == "0") { BluetoothUtil.BlueToothDataSend(BluetoothConnection1, ((AgreeMent)LoginRoler.AgreeMents[Constant.心前区震颤无]).Agreement); } //心尖搏动 if (_听诊模拟人.心尖搏动 == "1") { BluetoothUtil.BlueToothDataSend(BluetoothConnection1, ((AgreeMent)LoginRoler.AgreeMents[Constant.心尖搏动有]).Agreement); } else if (_听诊模拟人.心尖搏动 == "0") { BluetoothUtil.BlueToothDataSend(BluetoothConnection1, ((AgreeMent)LoginRoler.AgreeMents[Constant.心尖搏动无]).Agreement ); } // }
private void load听诊人Data2Frm(听诊模拟人 _听诊模拟人) { if (_听诊模拟人!=null) { if (_听诊模拟人.心前区震颤 == "1") { this.心前区震颤有.Checked = true; } else if (_听诊模拟人.心前区震颤 == "0") { this.心前区震颤无.Checked = true; } if (_听诊模拟人.心尖搏动 == "1") { this.心尖搏动有.Checked = true; } else if (_听诊模拟人.心尖搏动 == "0") { this.心尖搏动无.Checked = true; } this.二尖瓣听诊区.Text = _听诊模拟人.二尖瓣听诊区; this.肺动脉瓣听诊区.Text = _听诊模拟人.肺动脉瓣听诊区; this.主动脉瓣区.Text = _听诊模拟人.主动脉瓣区; this.主动脉瓣第二听诊区.Text = _听诊模拟人.主动脉瓣第二听诊区; this.三尖瓣区.Text = _听诊模拟人.三尖瓣区; this.气管.Text = _听诊模拟人.气管; this.左肺上.Text = _听诊模拟人.左肺上; this.左肺中.Text = _听诊模拟人.左肺中; this.左肺下.Text = _听诊模拟人.左肺下; this.右肺上.Text = _听诊模拟人.右肺上; this.右肺中.Text = _听诊模拟人.右肺中; this.右肺下.Text = _听诊模拟人.右肺下; } }
private 听诊模拟人 get听诊模拟人数据() { 听诊模拟人 _听诊模拟人 = new 听诊模拟人(); if (this.心前区震颤有.Checked) { _听诊模拟人.心前区震颤 = "1"; } if (this.心前区震颤无.Checked) { _听诊模拟人.心前区震颤 = "0"; } if (this.心尖搏动有.Checked) { _听诊模拟人.心尖搏动 = "1"; } if (this.心尖搏动无.Checked) { _听诊模拟人.心尖搏动 = "0"; } _听诊模拟人.二尖瓣听诊区 = this.二尖瓣听诊区.Text; _听诊模拟人.肺动脉瓣听诊区 = this.肺动脉瓣听诊区.Text; _听诊模拟人.主动脉瓣区 = this.主动脉瓣区.Text; _听诊模拟人.主动脉瓣第二听诊区 = this.主动脉瓣第二听诊区.Text; _听诊模拟人.三尖瓣区 = this.三尖瓣区.Text; _听诊模拟人.气管 = this.气管.Text; _听诊模拟人.左肺上 = this.左肺上.Text; _听诊模拟人.左肺中 = this.左肺中.Text; _听诊模拟人.左肺下 = this.左肺下.Text; _听诊模拟人.右肺上 = this.右肺上.Text; _听诊模拟人.右肺中 = this.右肺中.Text; _听诊模拟人.右肺下 = this.右肺下.Text; return _听诊模拟人; }