public bool aUdiabetesPatient(bean.diabetes_follow_recordBean hm, string id, DataTable goodsList)
        {
            int    ret  = 0;
            String sql  = "";
            String sql0 = "";

            if (id == "")
            {
                id   = Result.GetNewId();
                sql  = @"insert into diabetes_follow_record (id,name,aichive_no,id_number,visit_date,visit_type,symptom,symptom_other,blood_pressure_high,blood_pressure_low,weight_now,weight_next,bmi_now,bmi_next,dorsal_artery,other,smoke_now,smoke_next,drink_now,drink_next,sports_num_now,sports_time_now,sports_num_next,sports_time_next,staple_food_now,staple_food_next,psychological_recovery,medical_compliance,blood_glucose,glycosylated_hemoglobin,check_date,compliance,untoward_effect,reactive_hypoglycemia,follow_type,insulin_name,insulin_usage,transfer_treatment,transfer_treatment_reason,transfer_treatment_department,next_visit_date,visit_doctor,create_user,create_name,create_org,create_org_name,create_time,upload_status,upload_time,upload_result,advice) values ";
                sql += @" ('" + id + "','" + hm.name + "', '" + hm.aichive_no + "', '" + hm.id_number + "', '" + hm.visit_date + "', '" + hm.visit_type + "', '" + hm.symptom + "', '" + hm.symptom_other + "', '" + hm.blood_pressure_high + "', '" + hm.blood_pressure_low + "', '" + hm.weight_now + "','" + hm.weight_next + "', '" + hm.bmi_now + "', '" + hm.bmi_next + "', '" + hm.dorsal_artery + "', '" + hm.other + "', '" + hm.smoke_now + "', '" + hm.smoke_next + "','" + hm.drink_now + "', '" + hm.drink_next + "', '" + hm.sports_num_now + "', '" + hm.sports_time_now + "','" + hm.sports_num_next + "', '" + hm.sports_time_next + "','" + hm.staple_food_now + "', '" + hm.staple_food_next + "', '" + hm.psychological_recovery + "', '" + hm.medical_compliance + "', '" + hm.blood_glucose + "','" + hm.glycosylated_hemoglobin + "', '" + hm.check_date + "', '" + hm.compliance + "','" + hm.untoward_effect + "', '" + hm.reactive_hypoglycemia + "', '" + hm.follow_type + "', '" + hm.insulin_name + "', '" + hm.insulin_usage + "', '" + hm.transfer_treatment + "', '" + hm.transfer_treatment_reason + "', '" + hm.transfer_treatment_department + "','" + hm.next_visit_date + "', '" + hm.visit_doctor + "','" + frmLogin.userCode + "', '" + frmLogin.name + "', '" + frmLogin.organCode + "', '" + frmLogin.organName + "', '" + hm.create_time + "','" + hm.upload_status + "', '" + hm.upload_time + "', '" + hm.upload_result + "', '" + hm.advice + "')";
                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") + "')";
                        }
                    }
                }
            }
            else
            {
                //sql = @"update diabetes_follow_record set name='" + hm.name + "',aichive_no='" + hm.aichive_no + "',id_number='" + hm.id_number + "',visit_date= '" + hm.visit_date + "',visit_type='" + hm.visit_type + "',symptom='" + hm.symptom + "',symptom_other='" + hm.symptom_other + "',blood_pressure_high='" + hm.blood_pressure_high + "',blood_pressure_low= '" + hm.blood_pressure_low + "',weight_now='" + hm.weight_now + "',weight_next='" + hm.weight_next + "',bmi_now= '" + hm.bmi_now + "',bmi_next='" + hm.bmi_next + "',dorsal_artery='" + hm.dorsal_artery + "',other='" + hm.other + "',smoke_now= '" + hm.smoke_now + "',smoke_next='" + hm.smoke_next + "',drink_now='" + hm.drink_now + "',drink_next='" + hm.drink_next + "',sports_num_now='" + hm.sports_num_now + "',sports_time_now='" + hm.sports_time_now + "',sports_num_next='" + hm.sports_num_next + "',sports_time_next='" + hm.sports_time_next + "',staple_food_now='" + hm.staple_food_now + "',staple_food_next='" + hm.staple_food_next + "',psychological_recovery= '" + hm.psychological_recovery + "',medical_compliance='" + hm.medical_compliance + "',blood_glucose='" + hm.blood_glucose + "',glycosylated_hemoglobin='" + hm.glycosylated_hemoglobin + "',check_date='" + hm.check_date + "',compliance='" + hm.compliance + "',untoward_effect='" + hm.untoward_effect + "',reactive_hypoglycemia='" + hm.reactive_hypoglycemia + "',follow_type='" + hm.follow_type + "',insulin_name= '" + hm.insulin_name + "',insulin_usage='" + hm.insulin_usage + "',transfer_treatment='" + hm.transfer_treatment + "',transfer_treatment_reason='" + hm.transfer_treatment_reason + "',transfer_treatment_department= '" + hm.transfer_treatment_department + "',next_visit_date='" + hm.next_visit_date + "',visit_doctor='" + hm.visit_doctor + "',create_user='******',create_name='" + hm.create_name + "',create_org='" + hm.create_org + "',create_org_name='" + hm.create_org_name + "',create_time='" + hm.create_time + "',update_user='******',update_name= '" + hm.update_name + "',update_time='" + hm.update_time + "',upload_status='" + hm.upload_status + "',upload_time='" + hm.upload_time + "',upload_result='" + hm.upload_result + "',advice= '" + hm.advice + "' where id = '" + id + "'";
                sql  = @"update diabetes_follow_record set visit_date= '" + hm.visit_date + "',visit_type='" + hm.visit_type + "',symptom='" + hm.symptom + "',symptom_other='" + hm.symptom_other + "',blood_pressure_high='" + hm.blood_pressure_high + "',blood_pressure_low= '" + hm.blood_pressure_low + "',weight_now='" + hm.weight_now + "',weight_next='" + hm.weight_next + "',bmi_now= '" + hm.bmi_now + "',bmi_next='" + hm.bmi_next + "',dorsal_artery='" + hm.dorsal_artery + "',other='" + hm.other + "',smoke_now= '" + hm.smoke_now + "',smoke_next='" + hm.smoke_next + "',drink_now='" + hm.drink_now + "',drink_next='" + hm.drink_next + "',sports_num_now='" + hm.sports_num_now + "',sports_time_now='" + hm.sports_time_now + "',sports_num_next='" + hm.sports_num_next + "',sports_time_next='" + hm.sports_time_next + "',staple_food_now='" + hm.staple_food_now + "',staple_food_next='" + hm.staple_food_next + "',psychological_recovery= '" + hm.psychological_recovery + "',medical_compliance='" + hm.medical_compliance + "',blood_glucose='" + hm.blood_glucose + "',glycosylated_hemoglobin='" + hm.glycosylated_hemoglobin + "',compliance='" + hm.compliance + "',untoward_effect='" + hm.untoward_effect + "',reactive_hypoglycemia='" + hm.reactive_hypoglycemia + "',follow_type='" + hm.follow_type + "',insulin_name= '" + hm.insulin_name + "',insulin_usage='" + hm.insulin_usage + "',transfer_treatment='" + hm.transfer_treatment + "',transfer_treatment_reason='" + hm.transfer_treatment_reason + "',transfer_treatment_department= '" + hm.transfer_treatment_department + "',next_visit_date='" + hm.next_visit_date + "',visit_doctor='" + hm.visit_doctor + "',update_user='******',update_name= '" + frmLogin.name + "',update_time='" + hm.update_time + "',upload_status='" + hm.upload_status + "',upload_time='" + hm.upload_time + "',upload_result='" + hm.upload_result + "',advice= '" + hm.advice + "' 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);
        }
Exemple #2
0
 public bool aUdiabetesPatient(bean.diabetes_follow_recordBean hm, string id, DataTable goodsList)
 {
     return(hPD.aUdiabetesPatient(hm, id, goodsList));
 }
Exemple #3
0
        private void button4_Click(object sender, EventArgs e)
        {
            bean.diabetes_follow_recordBean diabetes_follow_recordBean = new bean.diabetes_follow_recordBean();

            diabetes_follow_recordBean.name       = this.textBox1.Text.Replace(" ", "");
            diabetes_follow_recordBean.aichive_no = this.textBox2.Text.Replace(" ", "");
            diabetes_follow_recordBean.visit_date = this.dateTimePicker1.Value.ToString();
            if (this.radioButton1.Checked == true)
            {
                diabetes_follow_recordBean.visit_type = this.radioButton1.Text;
            }
            ;
            if (this.radioButton2.Checked == true)
            {
                diabetes_follow_recordBean.visit_type = this.radioButton2.Text;
            }
            ;
            if (this.radioButton3.Checked == true)
            {
                diabetes_follow_recordBean.visit_type = this.radioButton3.Text;
            }
            ;
            foreach (Control ctr in this.panel2.Controls)
            {
                //判断该控件是不是CheckBox
                if (ctr is CheckBox)
                {
                    //将ctr转换成CheckBox并赋值给ck
                    CheckBox ck = ctr as CheckBox;
                    if (ck.Checked)
                    {
                        diabetes_follow_recordBean.symptom += "," + ck.Text;
                    }
                }
            }
            if (diabetes_follow_recordBean.symptom != null && diabetes_follow_recordBean.symptom != "")
            {
                diabetes_follow_recordBean.symptom = diabetes_follow_recordBean.symptom.Substring(1);
            }
            diabetes_follow_recordBean.symptom_other = this.richTextBox1.Text;

            diabetes_follow_recordBean.blood_pressure_high = this.numericUpDown9.Value.ToString();
            diabetes_follow_recordBean.blood_pressure_low  = this.numericUpDown10.Value.ToString();
            diabetes_follow_recordBean.weight_now          = this.numericUpDown11.Value.ToString();
            diabetes_follow_recordBean.weight_next         = this.numericUpDown12.Value.ToString();
            diabetes_follow_recordBean.bmi_now             = this.numericUpDown14.Value.ToString();
            diabetes_follow_recordBean.bmi_next            = this.numericUpDown15.Value.ToString();
            foreach (Control ctr in this.panel11.Controls)
            {
                //判断该控件是不是CheckBox
                if (ctr is CheckBox)
                {
                    //将ctr转换成CheckBox并赋值给ck
                    CheckBox ck = ctr as CheckBox;
                    if (ck.Checked)
                    {
                        diabetes_follow_recordBean.dorsal_artery += "," + ck.Text;
                    }
                }
            }
            if (diabetes_follow_recordBean.dorsal_artery != null && diabetes_follow_recordBean.dorsal_artery != "")
            {
                diabetes_follow_recordBean.dorsal_artery = diabetes_follow_recordBean.dorsal_artery.Substring(1);
            }

            diabetes_follow_recordBean.other = this.richTextBox3.Text;

            diabetes_follow_recordBean.smoke_now        = this.numericUpDown1.Value.ToString();
            diabetes_follow_recordBean.smoke_next       = this.numericUpDown2.Value.ToString();
            diabetes_follow_recordBean.drink_now        = this.numericUpDown3.Value.ToString();
            diabetes_follow_recordBean.drink_next       = this.numericUpDown4.Value.ToString();
            diabetes_follow_recordBean.sports_num_now   = this.numericUpDown5.Value.ToString();
            diabetes_follow_recordBean.sports_time_now  = this.numericUpDown6.Value.ToString();
            diabetes_follow_recordBean.sports_num_next  = this.numericUpDown7.Value.ToString();
            diabetes_follow_recordBean.sports_time_next = this.numericUpDown8.Value.ToString();
            diabetes_follow_recordBean.staple_food_now  = this.numericUpDown13.Value.ToString();
            diabetes_follow_recordBean.staple_food_next = this.numericUpDown16.Value.ToString();
            if (this.radioButton10.Checked == true)
            {
                diabetes_follow_recordBean.psychological_recovery = this.radioButton10.Text;
            }
            ;
            if (this.radioButton11.Checked == true)
            {
                diabetes_follow_recordBean.psychological_recovery = this.radioButton11.Text;
            }
            ;
            if (this.radioButton12.Checked == true)
            {
                diabetes_follow_recordBean.psychological_recovery = this.radioButton12.Text;
            }
            ;
            if (this.radioButton13.Checked == true)
            {
                diabetes_follow_recordBean.medical_compliance = this.radioButton13.Text;
            }
            ;
            if (this.radioButton14.Checked == true)
            {
                diabetes_follow_recordBean.medical_compliance = this.radioButton14.Text;
            }
            ;
            if (this.radioButton15.Checked == true)
            {
                diabetes_follow_recordBean.medical_compliance = this.radioButton15.Text;
            }
            ;

            diabetes_follow_recordBean.blood_glucose           = this.numericUpDown17.Value.ToString();
            diabetes_follow_recordBean.glycosylated_hemoglobin = this.numericUpDown18.Value.ToString();
            if (this.radioButton22.Checked == true)
            {
                diabetes_follow_recordBean.compliance = this.radioButton22.Text;
            }
            ;
            if (this.radioButton23.Checked == true)
            {
                diabetes_follow_recordBean.compliance = this.radioButton23.Text;
            }
            ;
            if (this.radioButton24.Checked == true)
            {
                diabetes_follow_recordBean.compliance = this.radioButton24.Text;
            }
            ;
            if (this.radioButton16.Checked == true)
            {
                diabetes_follow_recordBean.untoward_effect = this.radioButton16.Text;
            }
            ;
            if (this.radioButton17.Checked == true)
            {
                diabetes_follow_recordBean.untoward_effect = this.radioButton17.Text;
            }
            ;
            if (this.radioButton4.Checked == true)
            {
                diabetes_follow_recordBean.reactive_hypoglycemia = this.radioButton4.Text;
            }
            ;
            if (this.radioButton5.Checked == true)
            {
                diabetes_follow_recordBean.reactive_hypoglycemia = this.radioButton5.Text;
            }
            ;
            if (this.radioButton6.Checked == true)
            {
                diabetes_follow_recordBean.reactive_hypoglycemia = this.radioButton6.Text;
            }
            ;

            if (this.radioButton18.Checked == true)
            {
                diabetes_follow_recordBean.follow_type = this.radioButton18.Text;
            }
            ;
            if (this.radioButton19.Checked == true)
            {
                diabetes_follow_recordBean.follow_type = this.radioButton19.Text;
            }
            ;
            if (this.radioButton20.Checked == true)
            {
                diabetes_follow_recordBean.follow_type = this.radioButton20.Text;
            }
            ;
            if (this.radioButton21.Checked == true)
            {
                diabetes_follow_recordBean.follow_type = this.radioButton21.Text;
            }
            ;
            if (diabetes_follow_recordBean.follow_type == "")
            {
                MessageBox.Show("随访分类不能为空!"); return;
            }
            ;
            diabetes_follow_recordBean.advice = this.richTextBox2.Text;

            diabetes_follow_recordBean.transfer_treatment_reason     = this.textBox5.Text.Replace(" ", "");
            diabetes_follow_recordBean.transfer_treatment_department = this.textBox6.Text.Replace(" ", "");
            diabetes_follow_recordBean.next_visit_date = this.dateTimePicker2.Value.ToString();
            diabetes_follow_recordBean.visit_doctor    = this.textBox7.Text.Replace(" ", "");


            //以下页面未用 数据库字段格式要求
            diabetes_follow_recordBean.create_time   = DateTime.Now.ToString();
            diabetes_follow_recordBean.update_time   = DateTime.Now.ToString();
            diabetes_follow_recordBean.upload_time   = DateTime.Now.ToString();
            diabetes_follow_recordBean.upload_status = "0";

            bool isfalse = diabetesPatient.aUdiabetesPatient(diabetes_follow_recordBean, id, goodsList);

            if (isfalse)
            {
                this.DialogResult = DialogResult.OK;
            }
        }