public bool aUpsychosis_info(bean.psychosis_infoBean hm, string id) { int ret = 0; String sql = ""; if (id == "") { id = Result.GetNewId(); sql = @"insert into psychosis_info(id,name,archive_no,id_number,guardian_name,guardian_relation,guardian_address,guardian_phone,neighborhood_committee_linkman,neighborhood_committee_linktel,resident_type,employment_status,agree_manage,agree_name,agree_date,first_morbidity_date,symptom,isolation,outpatient,first_medicine_date,hospitalized_num,diagnosis,diagnosis_hospital,diagnosis_date,recently_treatment_effect,dangerous_act,slight_trouble_num,cause_trouble_num,cause_accident_num,harm_other_num,autolesion_num,attempted_suicide_num,economics,specialist_suggestion,record_date,record_doctor,create_user,create_name,create_org,create_org_name,create_time,upload_status) values "; sql += @" ('" + id + "','" + hm.name + "', '" + hm.archive_no + "', '" + hm.id_number + "', '" + hm.guardian_name + "', '" + hm.guardian_relation + "', '" + hm.guardian_address + "', '" + hm.guardian_phone + "', '" + hm.neighborhood_committee_linkman + "', '" + hm.neighborhood_committee_linktel + "', '" + hm.resident_type + "','" + hm.employment_status + "', '" + hm.agree_manage + "', '" + hm.agree_name + "', '" + hm.agree_date + "', '" + hm.first_morbidity_date + "', '" + hm.symptom + "', '" + hm.isolation + "', '" + hm.outpatient + "', '" + hm.first_medicine_date + "', '" + hm.hospitalized_num + "','" + hm.diagnosis + "', '" + hm.diagnosis_hospital + "', '" + hm.diagnosis_date + "', '" + hm.recently_treatment_effect + "', '" + hm.dangerous_act + "', '" + hm.slight_trouble_num + "', '" + hm.cause_trouble_num + "', '" + hm.cause_accident_num + "', '" + hm.harm_other_num + "', '" + hm.autolesion_num + "','" + hm.attempted_suicide_num + "', '" + hm.economics + "', '" + hm.specialist_suggestion + "', '" + hm.record_date + "', '" + hm.record_doctor + "', '" + frmLogin.userCode + "', '" + frmLogin.name + "', '" + frmLogin.organCode + "', '" + frmLogin.organName + "','" + hm.create_time + "', '" + hm.upload_status + "')"; } else { sql = @"update psychosis_info set guardian_name ='" + hm.guardian_name + "',guardian_relation='" + hm.guardian_relation + "',guardian_address='" + hm.guardian_address + "',guardian_phone='" + hm.guardian_phone + "',neighborhood_committee_linkman='" + hm.neighborhood_committee_linkman + "',neighborhood_committee_linktel='" + hm.neighborhood_committee_linktel + "',resident_type='" + hm.resident_type + "',employment_status='" + hm.employment_status + "',agree_manage='" + hm.agree_manage + "',agree_name='" + hm.agree_name + "',agree_date='" + hm.agree_date + "',first_morbidity_date='" + hm.first_morbidity_date + "',symptom='" + hm.symptom + "',isolation='" + hm.isolation + "',outpatient='" + hm.outpatient + "',first_medicine_date='" + hm.first_medicine_date + "',hospitalized_num='" + hm.hospitalized_num + "',diagnosis='" + hm.diagnosis + "',diagnosis_hospital='" + hm.diagnosis_hospital + "',diagnosis_date= '" + hm.diagnosis_date + "',recently_treatment_effect='" + hm.recently_treatment_effect + "',dangerous_act='" + hm.dangerous_act + "',slight_trouble_num= '" + hm.slight_trouble_num + "',cause_trouble_num= '" + hm.cause_trouble_num + "',cause_accident_num='" + hm.cause_accident_num + "',harm_other_num='" + hm.harm_other_num + "',autolesion_num= '" + hm.autolesion_num + "',attempted_suicide_num='" + hm.attempted_suicide_num + "',economics='" + hm.economics + "',specialist_suggestion='" + hm.specialist_suggestion + "',record_date='" + hm.record_date + "',record_doctor= '" + hm.record_doctor + "',update_user='******',update_name='" + frmLogin.name + "',update_time='" + hm.update_time + "',upload_status=0 where id = '" + id + "'"; } ret = DbHelperMySQL.ExecuteSql(sql); return(ret == 0 ? false : true); }
public bool aUpsychosis_info(bean.psychosis_infoBean hm, string id) { return(hPD.aUpsychosis_info(hm, id)); }
private void button4_Click(object sender, EventArgs e) { bean.psychosis_infoBean psychosis_infoBean = new bean.psychosis_infoBean(); psychosis_infoBean.name = this.textBox37.Text.Replace(" ", ""); psychosis_infoBean.archive_no = this.textBox39.Text.Replace(" ", ""); psychosis_infoBean.id_number = this.textBox41.Text.Replace(" ", ""); psychosis_infoBean.guardian_name = this.textBox1.Text.Replace(" ", ""); psychosis_infoBean.guardian_relation = this.textBox42.Text.Replace(" ", ""); psychosis_infoBean.guardian_phone = this.textBox2.Text.Replace(" ", ""); psychosis_infoBean.guardian_address = this.textBox5.Text.Replace(" ", ""); psychosis_infoBean.neighborhood_committee_linkman = this.textBox8.Text.Replace(" ", ""); psychosis_infoBean.neighborhood_committee_linktel = this.textBox11.Text.Replace(" ", ""); if (this.radioButton1.Checked == true) { psychosis_infoBean.resident_type = this.radioButton1.Tag.ToString(); } ; if (this.radioButton2.Checked == true) { psychosis_infoBean.resident_type = this.radioButton2.Tag.ToString(); } ; if (this.radioButton3.Checked == true) { psychosis_infoBean.employment_status = this.radioButton3.Tag.ToString(); } ; if (this.radioButton4.Checked == true) { psychosis_infoBean.employment_status = this.radioButton4.Tag.ToString(); } ; if (this.radioButton5.Checked == true) { psychosis_infoBean.employment_status = this.radioButton5.Tag.ToString(); } ; if (this.radioButton6.Checked == true) { psychosis_infoBean.employment_status = this.radioButton6.Tag.ToString(); } ; if (this.radioButton7.Checked == true) { psychosis_infoBean.employment_status = this.radioButton7.Tag.ToString(); } ; if (this.radioButton8.Checked == true) { psychosis_infoBean.employment_status = this.radioButton8.Tag.ToString(); } ; if (this.radioButton9.Checked == true) { psychosis_infoBean.employment_status = this.radioButton9.Tag.ToString(); } ; if (this.radioButton10.Checked == true) { psychosis_infoBean.employment_status = this.radioButton10.Tag.ToString(); } ; if (this.radioButton11.Checked == true) { psychosis_infoBean.employment_status = this.radioButton11.Tag.ToString(); } ; if (this.radioButton12.Checked == true) { psychosis_infoBean.agree_manage = this.radioButton12.Tag.ToString(); } ; if (this.radioButton13.Checked == true) { psychosis_infoBean.agree_manage = this.radioButton13.Tag.ToString(); } ; psychosis_infoBean.agree_name = this.textBox17.Text.Replace(" ", ""); psychosis_infoBean.agree_date = this.dateTimePicker1.Text.ToString(); psychosis_infoBean.first_morbidity_date = this.dateTimePicker3.Text.ToString(); foreach (Control ctr in this.panel5.Controls) { //判断该控件是不是CheckBox if (ctr is CheckBox) { //将ctr转换成CheckBox并赋值给ck CheckBox ck = ctr as CheckBox; if (ck.Checked) { psychosis_infoBean.symptom += "," + ck.Tag.ToString(); } } } if (psychosis_infoBean.symptom != null && psychosis_infoBean.symptom != "") { psychosis_infoBean.symptom = psychosis_infoBean.symptom.Substring(1); } if (this.radioButton14.Checked == true) { psychosis_infoBean.isolation = this.radioButton14.Tag.ToString(); } ; if (this.radioButton15.Checked == true) { psychosis_infoBean.isolation = this.radioButton15.Tag.ToString(); } ; if (this.radioButton16.Checked == true) { psychosis_infoBean.isolation = this.radioButton16.Tag.ToString(); } ; if (this.radioButton17.Checked == true) { psychosis_infoBean.outpatient = this.radioButton17.Tag.ToString(); } ; if (this.radioButton18.Checked == true) { psychosis_infoBean.outpatient = this.radioButton18.Tag.ToString(); } ; if (this.radioButton19.Checked == true) { psychosis_infoBean.outpatient = this.radioButton19.Tag.ToString(); } ; psychosis_infoBean.first_medicine_date = this.dateTimePicker4.Text.ToString(); psychosis_infoBean.hospitalized_num = this.numericUpDown1.Value.ToString(); psychosis_infoBean.diagnosis = this.textBox26.Text.Replace(" ", ""); psychosis_infoBean.diagnosis_hospital = this.textBox28.Text.Replace(" ", ""); psychosis_infoBean.diagnosis_date = this.dateTimePicker5.Text.ToString(); if (this.radioButton20.Checked == true) { psychosis_infoBean.recently_treatment_effect = this.radioButton20.Tag.ToString(); } ; if (this.radioButton21.Checked == true) { psychosis_infoBean.recently_treatment_effect = this.radioButton21.Tag.ToString(); } ; if (this.radioButton22.Checked == true) { psychosis_infoBean.recently_treatment_effect = this.radioButton22.Tag.ToString(); } ; if (this.radioButton27.Checked == true) { psychosis_infoBean.recently_treatment_effect = this.radioButton27.Tag.ToString(); } ; if (!this.checkBox19.Checked) { foreach (Control ctr in this.panel10.Controls) { //判断该控件是不是CheckBox if (ctr is CheckBox) { //将ctr转换成CheckBox并赋值给ck CheckBox ck = ctr as CheckBox; if (ck.Checked) { psychosis_infoBean.dangerous_act += "," + ck.Tag.ToString(); } } } if (psychosis_infoBean.dangerous_act != null && psychosis_infoBean.dangerous_act != "") { psychosis_infoBean.dangerous_act = psychosis_infoBean.dangerous_act.Substring(1); } if (this.checkBox13.Checked) { psychosis_infoBean.slight_trouble_num = this.numericUpDown2.Text; } if (this.checkBox14.Checked) { psychosis_infoBean.cause_trouble_num = this.numericUpDown3.Text; } if (this.checkBox15.Checked) { psychosis_infoBean.cause_accident_num = this.numericUpDown4.Text; } if (this.checkBox16.Checked) { psychosis_infoBean.harm_other_num = this.numericUpDown5.Text; } if (this.checkBox17.Checked) { psychosis_infoBean.autolesion_num = this.numericUpDown6.Text; } if (this.checkBox18.Checked) { psychosis_infoBean.attempted_suicide_num = this.numericUpDown7.Text; } } else { psychosis_infoBean.dangerous_act = "0"; } if (this.radioButton25.Checked == true) { psychosis_infoBean.economics = this.radioButton25.Tag.ToString(); } ; if (this.radioButton26.Checked == true) { psychosis_infoBean.economics = this.radioButton26.Tag.ToString(); } ; psychosis_infoBean.specialist_suggestion = this.textBox34.Text.Replace(" ", ""); psychosis_infoBean.record_date = this.dateTimePicker2.Text.ToString(); psychosis_infoBean.record_doctor = this.textBox7.Text.Replace(" ", ""); psychosis_infoBean.upload_status = "0"; psychosis_infoBean.create_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); psychosis_infoBean.update_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); psychosis_infoBean.upload_time = DateTime.Now.ToString("yyyy-MM-dd"); bool isfalse = psychiatricPatient.aUpsychosis_info(psychosis_infoBean, id); if (isfalse) { this.DialogResult = DialogResult.OK; } }