Beispiel #1
0
        public bool aUPsychosis_follow_record(bean.psychosis_follow_recordBean hm, string id, DataTable goodsList)
        {
            int    ret  = 0;
            String sql  = "";
            String sql0 = "";

            if (id != "")
            {
                sql  = @"update psychosis_follow_record set treatment_effect='" + hm.treatment_effect + "', transfer_treatment='" + hm.transfer_treatment + "',transfer_treatment_reason='" + hm.transfer_treatment_reason + "',transfer_treatment_department='" + hm.transfer_treatment_department + "',rehabilitation_measure='" + hm.rehabilitation_measure + "',rehabilitation_measure_other='" + hm.rehabilitation_measure_other + "',next_visit_classify='" + hm.next_visit_classify + "',next_visit_date='" + hm.next_visit_date + "',visit_doctor='" + hm.visit_doctor + "' where id = '" + id + "'";
                sql0 = @"delete from follow_medicine_record  where follow_id = '" + id + "';";
                if (goodsList.Rows.Count > 0)
                {
                    for (int i = 0; i < goodsList.Rows.Count; i++)
                    {
                        if (i == 0)
                        {
                            sql0 += "insert into follow_medicine_record(follow_id,drug_name,num,dosage,upload_status,create_name,create_time) values ('" + id + "','" + goodsList.Rows[i]["drug_name"] + "','" + goodsList.Rows[i]["num"] + "','" + goodsList.Rows[i]["dosage"] + "','0','" + frmLogin.name + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "')";
                        }
                        else
                        {
                            sql0 += ",('" + id + "','" + goodsList.Rows[i]["drug_name"] + "','" + goodsList.Rows[i]["num"] + "','" + goodsList.Rows[i]["dosage"] + "','0','" + frmLogin.name + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "')";
                        }
                    }
                }
            }
            if (sql0 != "")
            {
                DbHelperMySQL.ExecuteSql(sql0);
            }
            ret = DbHelperMySQL.ExecuteSql(sql);
            return(ret == 0 ? false : true);
        }
Beispiel #2
0
        public bool aUPsychosis_follow_record(bean.psychosis_follow_recordBean hm, string id)
        {
            int    ret = 0;
            String sql = "";

            if (id == "")
            {
                id   = Result.GetNewId();
                sql  = @"insert into psychosis_follow_record(id,name,archive_no,Cardcode,visit_date,visit_type,miss_reason,miss_reason_other,die_date,die_reason,physical_disease,die_reason_other,fatalness,symptom,symptom_other,insight,sleep_status,dietary_status,self_help,housework,work,learning_ability,interpersonal,dangerous_act,slight_trouble_num,cause_trouble_num,cause_accident_num,harm_other_num,autolesion_num,attempted_suicide_num,isolation,hospitalized_status,out_hospital_date,laboratory_examination,compliance,untoward_effect,untoward_effect_info,create_user,create_name,create_org,create_org_name,create_time,upload_status) values ";
                sql += @" ('" + id + "','" + hm.name + "', '" + hm.archive_no + "', '" + hm.Cardcode + "', '" + hm.visit_date + "', '" + hm.visit_type + "', '" + hm.miss_reason + "', '" + hm.miss_reason_other + "', '" + hm.die_date + "', '" + hm.die_reason + "', '" + hm.physical_disease + "','" + hm.die_reason_other + "', '" + hm.fatalness + "', '" + hm.symptom + "', '" + hm.symptom_other + "', '" + hm.insight + "', '" + hm.sleep_status + "', '" + hm.dietary_status + "', '" + hm.self_help + "', '" + hm.housework + "', '" + hm.work + "','" + hm.learning_ability + "', '" + hm.interpersonal + "', '" + 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.isolation + "', '" + hm.hospitalized_status + "', '" + hm.out_hospital_date + "', '" + hm.laboratory_examination + "', '" + hm.compliance + "', '" + hm.untoward_effect + "', '" + hm.untoward_effect_info + "', '" + frmLogin.userCode + "', '" + frmLogin.name + "', '" + frmLogin.organCode + "', '" + frmLogin.organName + "', '" + hm.create_time + "', '" + hm.upload_status + "')";
            }
            else
            {
                sql = @"update psychosis_follow_record set visit_date ='" + hm.visit_date + "',visit_type='" + hm.visit_type + "',miss_reason='" + hm.miss_reason + "',miss_reason_other='" + hm.miss_reason_other + "',die_date='" + hm.die_date + "',die_reason='" + hm.die_reason + "',physical_disease='" + hm.physical_disease + "',die_reason_other='" + hm.die_reason_other + "',fatalness='" + hm.fatalness + "',symptom='" + hm.symptom + "',symptom_other='" + hm.symptom_other + "',insight='" + hm.insight + "',sleep_status='" + hm.sleep_status + "',dietary_status='" + hm.dietary_status + "',self_help='" + hm.self_help + "',housework='" + hm.housework + "',work='" + hm.work + "',learning_ability='" + hm.learning_ability + "',interpersonal='" + hm.interpersonal + "',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 + "',isolation='" + hm.isolation + "',hospitalized_status='" + hm.hospitalized_status + "',out_hospital_date='" + hm.out_hospital_date + "',laboratory_examination='" + hm.laboratory_examination + "',compliance='" + hm.compliance + "',untoward_effect= '" + hm.untoward_effect + "',untoward_effect_info='" + hm.untoward_effect_info + "',upload_status=0 where id = '" + id + "'";
            }
            ret = DbHelperMySQL.ExecuteSql(sql);

            return(ret == 0 ? false : true);
        }
 public bool aUPsychosis_follow_record(bean.psychosis_follow_recordBean hm, string id, DataTable goodsList)
 {
     return(hPD.aUPsychosis_follow_record(hm, id, goodsList));
 }
        private void button4_Click(object sender, EventArgs e)
        {
            bean.psychosis_follow_recordBean psychosis_follow_recordBean = new bean.psychosis_follow_recordBean();

            psychosis_follow_recordBean.name       = this.textBox37.Text.Replace(" ", "");
            psychosis_follow_recordBean.archive_no = this.textBox39.Text.Replace(" ", "");
            psychosis_follow_recordBean.Cardcode   = this.textBox41.Text.Replace(" ", "");
            psychosis_follow_recordBean.visit_date = this.dateTimePicker5.Text.ToString();

            if (this.radioButton1.Checked == true)
            {
                psychosis_follow_recordBean.visit_type = this.radioButton1.Tag.ToString();
            }
            ;
            if (this.radioButton2.Checked == true)
            {
                psychosis_follow_recordBean.visit_type = this.radioButton2.Tag.ToString();
            }
            ;
            if (this.radioButton11.Checked == true)
            {
                psychosis_follow_recordBean.visit_type = this.radioButton11.Tag.ToString();
            }
            ;

            if (this.radioButton3.Checked == true)
            {
                psychosis_follow_recordBean.miss_reason = this.radioButton3.Tag.ToString();
            }
            ;
            if (this.radioButton4.Checked == true)
            {
                psychosis_follow_recordBean.miss_reason = this.radioButton4.Tag.ToString();
            }
            ;
            if (this.radioButton5.Checked == true)
            {
                psychosis_follow_recordBean.miss_reason = this.radioButton5.Tag.ToString();
            }
            ;
            if (this.radioButton6.Checked == true)
            {
                psychosis_follow_recordBean.miss_reason = this.radioButton6.Tag.ToString();
            }
            ;
            if (this.radioButton7.Checked == true)
            {
                psychosis_follow_recordBean.miss_reason       = this.radioButton7.Tag.ToString();
                psychosis_follow_recordBean.miss_reason_other = this.textBox18.Text;
            }
            ;

            psychosis_follow_recordBean.die_date = this.dateTimePicker3.Text.ToString();

            if (this.radioButton14.Checked == true)
            {
                psychosis_follow_recordBean.die_reason = this.radioButton14.Tag.ToString();
            }
            ;
            if (this.radioButton15.Checked == true)
            {
                psychosis_follow_recordBean.die_reason = this.radioButton15.Tag.ToString();
            }
            ;
            if (this.radioButton16.Checked == true)
            {
                psychosis_follow_recordBean.die_reason = this.radioButton16.Tag.ToString();
            }
            ;
            if (this.radioButton17.Checked == true)
            {
                psychosis_follow_recordBean.die_reason = this.radioButton17.Tag.ToString();
            }
            ;
            if (this.radioButton18.Checked == true)
            {
                psychosis_follow_recordBean.die_reason = this.radioButton18.Tag.ToString();
            }
            ;
            if (this.radioButton19.Checked == true)
            {
                psychosis_follow_recordBean.die_reason       = this.radioButton19.Tag.ToString();
                psychosis_follow_recordBean.die_reason_other = this.textBox44.Text;
            }
            ;

            psychosis_follow_recordBean.physical_disease = this.textBox26.Text.Replace(" ", "");

            if (this.radioButton20.Checked == true)
            {
                psychosis_follow_recordBean.fatalness = this.radioButton20.Tag.ToString();
            }
            ;
            if (this.radioButton21.Checked == true)
            {
                psychosis_follow_recordBean.fatalness = this.radioButton21.Tag.ToString();
            }
            ;
            if (this.radioButton22.Checked == true)
            {
                psychosis_follow_recordBean.fatalness = this.radioButton22.Tag.ToString();
            }
            ;
            if (this.radioButton23.Checked == true)
            {
                psychosis_follow_recordBean.fatalness = this.radioButton23.Tag.ToString();
            }
            ;
            if (this.radioButton24.Checked == true)
            {
                psychosis_follow_recordBean.fatalness = this.radioButton24.Tag.ToString();
            }
            ;
            if (this.radioButton26.Checked == true)
            {
                psychosis_follow_recordBean.fatalness = this.radioButton26.Tag.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_follow_recordBean.symptom += "," + ck.Tag.ToString();
                    }
                }
            }
            if (psychosis_follow_recordBean.symptom != null && psychosis_follow_recordBean.symptom != "")
            {
                psychosis_follow_recordBean.symptom = psychosis_follow_recordBean.symptom.Substring(1);
            }
            psychosis_follow_recordBean.symptom_other = this.textBox45.Text;

            if (this.radioButton25.Checked == true)
            {
                psychosis_follow_recordBean.insight = this.radioButton25.Tag.ToString();
            }
            ;
            if (this.radioButton8.Checked == true)
            {
                psychosis_follow_recordBean.insight = this.radioButton8.Tag.ToString();
            }
            ;
            if (this.radioButton9.Checked == true)
            {
                psychosis_follow_recordBean.insight = this.radioButton9.Tag.ToString();
            }
            ;

            if (this.radioButton10.Checked == true)
            {
                psychosis_follow_recordBean.sleep_status = this.radioButton10.Tag.ToString();
            }
            ;
            if (this.radioButton12.Checked == true)
            {
                psychosis_follow_recordBean.sleep_status = this.radioButton12.Tag.ToString();
            }
            ;
            if (this.radioButton40.Checked == true)
            {
                psychosis_follow_recordBean.sleep_status = this.radioButton40.Tag.ToString();
            }
            ;

            if (this.radioButton13.Checked == true)
            {
                psychosis_follow_recordBean.dietary_status = this.radioButton13.Tag.ToString();
            }
            ;
            if (this.radioButton27.Checked == true)
            {
                psychosis_follow_recordBean.dietary_status = this.radioButton27.Tag.ToString();
            }
            ;
            if (this.radioButton41.Checked == true)
            {
                psychosis_follow_recordBean.dietary_status = this.radioButton41.Tag.ToString();
            }
            ;

            if (this.radioButton28.Checked == true)
            {
                psychosis_follow_recordBean.self_help = this.radioButton28.Tag.ToString();
            }
            ;
            if (this.radioButton29.Checked == true)
            {
                psychosis_follow_recordBean.self_help = this.radioButton29.Tag.ToString();
            }
            ;
            if (this.radioButton56.Checked == true)
            {
                psychosis_follow_recordBean.self_help = this.radioButton56.Tag.ToString();
            }
            ;

            if (this.radioButton30.Checked == true)
            {
                psychosis_follow_recordBean.housework = this.radioButton30.Tag.ToString();
            }
            ;
            if (this.radioButton31.Checked == true)
            {
                psychosis_follow_recordBean.housework = this.radioButton31.Tag.ToString();
            }
            ;
            if (this.radioButton59.Checked == true)
            {
                psychosis_follow_recordBean.housework = this.radioButton59.Tag.ToString();
            }
            ;

            if (this.radioButton32.Checked == true)
            {
                psychosis_follow_recordBean.work = this.radioButton32.Tag.ToString();
            }
            ;
            if (this.radioButton33.Checked == true)
            {
                psychosis_follow_recordBean.work = this.radioButton33.Tag.ToString();
            }
            ;
            if (this.radioButton57.Checked == true)
            {
                psychosis_follow_recordBean.work = this.radioButton57.Tag.ToString();
            }
            ;
            if (this.radioButton62.Checked == true)
            {
                psychosis_follow_recordBean.work = this.radioButton62.Tag.ToString();
            }
            ;

            if (this.radioButton34.Checked == true)
            {
                psychosis_follow_recordBean.learning_ability = this.radioButton34.Tag.ToString();
            }
            ;
            if (this.radioButton35.Checked == true)
            {
                psychosis_follow_recordBean.learning_ability = this.radioButton35.Tag.ToString();
            }
            ;
            if (this.radioButton60.Checked == true)
            {
                psychosis_follow_recordBean.learning_ability = this.radioButton60.Tag.ToString();
            }
            ;

            if (this.radioButton36.Checked == true)
            {
                psychosis_follow_recordBean.interpersonal = this.radioButton36.Tag.ToString();
            }
            ;
            if (this.radioButton37.Checked == true)
            {
                psychosis_follow_recordBean.interpersonal = this.radioButton37.Tag.ToString();
            }
            ;
            if (this.radioButton58.Checked == true)
            {
                psychosis_follow_recordBean.interpersonal = this.radioButton58.Tag.ToString();
            }
            ;

            if (this.radioButton38.Checked == true)
            {
                psychosis_follow_recordBean.dangerous_act = this.radioButton38.Tag.ToString();
            }
            ;
            if (this.radioButton39.Checked == true)
            {
                psychosis_follow_recordBean.dangerous_act = this.radioButton39.Tag.ToString();
            }
            ;

            psychosis_follow_recordBean.slight_trouble_num    = this.numericUpDown1.Value.ToString();
            psychosis_follow_recordBean.cause_trouble_num     = this.numericUpDown2.Value.ToString();
            psychosis_follow_recordBean.cause_accident_num    = this.numericUpDown3.Value.ToString();
            psychosis_follow_recordBean.autolesion_num        = this.numericUpDown4.Value.ToString();
            psychosis_follow_recordBean.attempted_suicide_num = this.numericUpDown5.Value.ToString();
            psychosis_follow_recordBean.harm_other_num        = this.numericUpDown6.Value.ToString();

            if (this.radioButton42.Checked == true)
            {
                psychosis_follow_recordBean.isolation = this.radioButton42.Tag.ToString();
            }
            ;
            if (this.radioButton43.Checked == true)
            {
                psychosis_follow_recordBean.isolation = this.radioButton43.Tag.ToString();
            }
            ;
            if (this.radioButton44.Checked == true)
            {
                psychosis_follow_recordBean.isolation = this.radioButton44.Tag.ToString();
            }
            ;

            if (this.radioButton45.Checked == true)
            {
                psychosis_follow_recordBean.hospitalized_status = this.radioButton45.Tag.ToString();
            }
            ;
            if (this.radioButton46.Checked == true)
            {
                psychosis_follow_recordBean.hospitalized_status = this.radioButton46.Tag.ToString();
            }
            ;
            if (this.radioButton47.Checked == true)
            {
                psychosis_follow_recordBean.hospitalized_status = this.radioButton47.Tag.ToString();
            }
            ;

            psychosis_follow_recordBean.out_hospital_date = this.dateTimePicker1.Text.ToString();

            if (this.radioButton48.Checked == true)
            {
                psychosis_follow_recordBean.laboratory_examination = this.radioButton48.Tag.ToString();
            }
            ;
            if (this.radioButton49.Checked == true)
            {
                psychosis_follow_recordBean.laboratory_examination = this.radioButton49.Tag.ToString();
            }
            ;

            if (this.radioButton50.Checked == true)
            {
                psychosis_follow_recordBean.compliance = this.radioButton50.Tag.ToString();
            }
            ;
            if (this.radioButton51.Checked == true)
            {
                psychosis_follow_recordBean.compliance = this.radioButton51.Tag.ToString();
            }
            ;
            if (this.radioButton52.Checked == true)
            {
                psychosis_follow_recordBean.compliance = this.radioButton52.Tag.ToString();
            }
            ;
            if (this.radioButton53.Checked == true)
            {
                psychosis_follow_recordBean.compliance = this.radioButton53.Tag.ToString();
            }
            ;

            if (this.radioButton54.Checked == true)
            {
                psychosis_follow_recordBean.untoward_effect = this.radioButton54.Tag.ToString();
            }
            ;
            if (this.radioButton55.Checked == true)
            {
                psychosis_follow_recordBean.untoward_effect = this.radioButton55.Tag.ToString();
            }
            ;
            if (this.radioButton61.Checked == true)
            {
                psychosis_follow_recordBean.untoward_effect = this.radioButton61.Tag.ToString();
            }
            ;

            psychosis_follow_recordBean.untoward_effect_info = this.textBox7.Text.Replace(" ", "");


            ////以下页面未用 数据库字段格式要求

            psychosis_follow_recordBean.upload_status = "0";
            psychosis_follow_recordBean.create_time   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            psychosis_follow_recordBean.update_time   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            psychosis_follow_recordBean.upload_time   = DateTime.Now.ToString("yyyy-MM-dd");


            bool isfalse = psychiatricPatientS.aUPsychosis_follow_record(psychosis_follow_recordBean, id);

            if (isfalse)
            {
                this.Close();
                aUpsychiatricPatientServicesS1 auhc1 = new aUpsychiatricPatientServicesS1();
                auhc1.id         = id;//祖
                auhc1.archive_no = this.textBox39.Text.Replace(" ", "");
                if (auhc1.ShowDialog() == DialogResult.OK)
                {
                    this.DialogResult = DialogResult.OK;
                    MessageBox.Show("数据保存成功!");
                }
            }
            else
            {
                MessageBox.Show("保存不成功!");
            }
        }
 public bool aUPsychosis_follow_record(bean.psychosis_follow_recordBean hm, string id)
 {
     return(hPD.aUPsychosis_follow_record(hm, id));
 }