Esempio n. 1
0
 private void textBox12_TextChanged(object sender, EventArgs e)
 {
     if (this.textBox12.Text.Replace(" ", "").Length == 18 && id == "")
     {
         DataTable dt = personalBasicInfoService.query(this.textBox12.Text.Replace(" ", ""));
         if (dt.Rows.Count > 0)
         {
             this.textBox12.Text = "";
             MessageBox.Show("此身份证号已注册");
         }
     }
 }
Esempio n. 2
0
        private void DisplayPersonTeShuInfo(string id_number)
        {
            label45.Text = "";
            service.personalBasicInfoService pBasicInfo = new service.personalBasicInfoService();
            DataTable dt = pBasicInfo.query(id_number);

            if (dt == null || dt.Rows.Count <= 0)
            {
                return;
            }
            string tmp = dt.Rows[0]["is_hypertension"].ToString();

            if (tmp == "")
            {
                tmp = "0";
            }
            int is_hypertension = int.Parse(tmp);

            tmp = dt.Rows[0]["is_diabetes"].ToString();
            if (tmp == "")
            {
                tmp = "0";
            }
            int is_diabetes = int.Parse(tmp);

            tmp = dt.Rows[0]["is_psychosis"].ToString();
            if (tmp == "")
            {
                tmp = "0";
            }
            int is_psychosis = int.Parse(tmp);

            tmp = dt.Rows[0]["is_tuberculosis"].ToString();
            if (tmp == "")
            {
                tmp = "0";
            }
            int is_tuberculosis = int.Parse(tmp);

            string _teshubiaoqian = "";

            if (is_hypertension != 0)
            {
                _teshubiaoqian = _teshubiaoqian + " 高";
            }
            if (is_diabetes != 0)
            {
                _teshubiaoqian = _teshubiaoqian + " 糖";
            }
            if (is_psychosis != 0)
            {
                _teshubiaoqian = _teshubiaoqian + " 精";
            }
            if (is_tuberculosis != 0)
            {
                _teshubiaoqian = _teshubiaoqian + " 结";
            }
            if (_teshubiaoqian != "")
            {
                label45.Text = _teshubiaoqian;
            }
        }
Esempio n. 3
0
        private void button4_Click(object sender, EventArgs e)
        {
            bean.resident_base_infoBean resident_base_infoBean = new bean.resident_base_infoBean();

            resident_base_infoBean.name       = this.textBox1.Text.Replace(" ", "");
            resident_base_infoBean.archive_no = this.textBox2.Text.Replace(" ", "");
            resident_base_infoBean.pb_archive = this.textBox2.Text.Replace(" ", "");
            if (this.radioButton1.Checked == true)
            {
                resident_base_infoBean.sex = this.radioButton1.Tag.ToString();
            }
            ;
            if (this.radioButton2.Checked == true)
            {
                resident_base_infoBean.sex = this.radioButton2.Tag.ToString();
            }
            ;
            if (this.radioButton3.Checked == true)
            {
                resident_base_infoBean.sex = this.radioButton3.Tag.ToString();
            }
            ;
            if (this.radioButton25.Checked == true)
            {
                resident_base_infoBean.sex = this.radioButton25.Tag.ToString();
            }
            ;
            resident_base_infoBean.birthday  = this.dateTimePicker1.Text;
            resident_base_infoBean.id_number = this.textBox12.Text.Replace(" ", "");
            if (resident_base_infoBean.id_number == "" || resident_base_infoBean.id_number.Length != 18)
            {
                MessageBox.Show("身份证号码不正确!");
                return;
            }
            else
            {
                //判断下身份证号不能重复
                DataTable dt = personalBasicInfoService.query(resident_base_infoBean.id_number);
                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["archive_no"].ToString() != resident_base_infoBean.archive_no)
                    {
                        MessageBox.Show("身份证号码已经使用!");
                        return;
                    }
                }
            }
            resident_base_infoBean.address           = this.textBox44.Text.Replace(" ", "");
            resident_base_infoBean.residence_address = this.textBox46.Text.Replace(" ", "");

            resident_base_infoBean.company    = this.textBox14.Text.Replace(" ", "");
            resident_base_infoBean.phone      = this.textBox16.Text.Replace(" ", "");
            resident_base_infoBean.link_name  = this.textBox18.Text.Replace(" ", "");
            resident_base_infoBean.link_phone = this.textBox20.Text.Replace(" ", "");
            if (this.radioButton4.Checked == true)
            {
                resident_base_infoBean.resident_type = this.radioButton4.Tag.ToString();
            }
            ;
            if (this.radioButton5.Checked == true)
            {
                resident_base_infoBean.resident_type = this.radioButton5.Tag.ToString();
            }
            ;

            if (this.radioButton6.Checked == true)
            {
                resident_base_infoBean.nation = this.radioButton6.Tag.ToString();
            }
            ;
            if (this.radioButton7.Checked == true)
            {
                if (mzid != "")
                {
                    resident_base_infoBean.nation = mzid;
                }
            }
            ;

            if (this.radioButton8.Checked == true)
            {
                resident_base_infoBean.blood_group = this.radioButton8.Tag.ToString();
            }
            ;
            if (this.radioButton9.Checked == true)
            {
                resident_base_infoBean.blood_group = this.radioButton9.Tag.ToString();
            }
            ;
            if (this.radioButton10.Checked == true)
            {
                resident_base_infoBean.blood_group = this.radioButton10.Tag.ToString();
            }
            ;
            if (this.radioButton11.Checked == true)
            {
                resident_base_infoBean.blood_group = this.radioButton11.Tag.ToString();
            }
            ;
            if (this.radioButton12.Checked == true)
            {
                resident_base_infoBean.blood_group = this.radioButton12.Tag.ToString();
            }
            ;

            if (this.radioButton13.Checked == true)
            {
                resident_base_infoBean.blood_rh = this.radioButton13.Tag.ToString();
            }
            ;
            if (this.radioButton14.Checked == true)
            {
                resident_base_infoBean.blood_rh = this.radioButton14.Tag.ToString();
            }
            ;
            if (this.radioButton15.Checked == true)
            {
                resident_base_infoBean.blood_rh = this.radioButton15.Tag.ToString();
            }
            ;

            if (this.radioButton22.Checked == true)
            {
                resident_base_infoBean.education = this.radioButton22.Tag.ToString();
            }
            ;
            if (this.radioButton23.Checked == true)
            {
                resident_base_infoBean.education = this.radioButton23.Tag.ToString();
            }
            ;
            if (this.radioButton24.Checked == true)
            {
                resident_base_infoBean.education = this.radioButton24.Tag.ToString();
            }
            ;
            if (this.radioButton26.Checked == true)
            {
                resident_base_infoBean.education = this.radioButton26.Tag.ToString();
            }
            ;
            if (this.radioButton27.Checked == true)
            {
                resident_base_infoBean.education = this.radioButton27.Tag.ToString();
            }
            ;
            if (this.radioButton28.Checked == true)
            {
                resident_base_infoBean.education = this.radioButton28.Tag.ToString();
            }
            ;
            if (this.radioButton29.Checked == true)
            {
                resident_base_infoBean.education = this.radioButton29.Tag.ToString();
            }
            ;
            if (this.radioButton30.Checked == true)
            {
                resident_base_infoBean.education = this.radioButton30.Tag.ToString();
            }
            ;
            if (this.radioButton31.Checked == true)
            {
                resident_base_infoBean.education = this.radioButton31.Tag.ToString();
            }
            ;
            if (this.radioButton32.Checked == true)
            {
                resident_base_infoBean.education = this.radioButton32.Tag.ToString();
            }
            ;

            if (this.radioButton33.Checked == true)
            {
                resident_base_infoBean.profession = this.radioButton33.Tag.ToString();
            }
            ;
            if (this.radioButton34.Checked == true)
            {
                resident_base_infoBean.profession = this.radioButton34.Tag.ToString();
            }
            ;
            if (this.radioButton35.Checked == true)
            {
                resident_base_infoBean.profession = this.radioButton35.Tag.ToString();
            }
            ;
            if (this.radioButton36.Checked == true)
            {
                resident_base_infoBean.profession = this.radioButton36.Tag.ToString();
            }
            ;
            if (this.radioButton37.Checked == true)
            {
                resident_base_infoBean.profession = this.radioButton37.Tag.ToString();
            }
            ;
            if (this.radioButton38.Checked == true)
            {
                resident_base_infoBean.profession = this.radioButton38.Tag.ToString();
            }
            ;
            if (this.radioButton39.Checked == true)
            {
                resident_base_infoBean.profession = this.radioButton39.Tag.ToString();
            }
            ;
            if (this.radioButton40.Checked == true)
            {
                resident_base_infoBean.profession = this.radioButton40.Tag.ToString();
            }
            ;
            if (this.radioButton41.Checked == true)
            {
                resident_base_infoBean.profession = this.radioButton41.Tag.ToString();
            }
            ;

            if (this.radioButton42.Checked == true)
            {
                resident_base_infoBean.marital_status = this.radioButton42.Tag.ToString();
            }
            ;
            if (this.radioButton43.Checked == true)
            {
                resident_base_infoBean.marital_status = this.radioButton43.Tag.ToString();
            }
            ;
            if (this.radioButton44.Checked == true)
            {
                resident_base_infoBean.marital_status = this.radioButton44.Tag.ToString();
            }
            ;
            if (this.radioButton45.Checked == true)
            {
                resident_base_infoBean.marital_status = this.radioButton45.Tag.ToString();
            }
            ;
            if (this.radioButton46.Checked == true)
            {
                resident_base_infoBean.marital_status = this.radioButton46.Tag.ToString();
            }
            ;

            foreach (Control ctr in this.panel12.Controls)
            {
                //判断该控件是不是CheckBox
                if (ctr is CheckBox)
                {
                    //将ctr转换成CheckBox并赋值给ck
                    CheckBox ck = ctr as CheckBox;
                    if (ck.Checked)
                    {
                        resident_base_infoBean.pay_type += "," + ck.Tag.ToString();;
                    }
                }
            }
            if (resident_base_infoBean.pay_type != null && resident_base_infoBean.pay_type != "")
            {
                resident_base_infoBean.pay_type = resident_base_infoBean.pay_type.Substring(1);
            }
            if (this.checkBox8.Checked)
            {
                resident_base_infoBean.pay_other = this.textBox38.Text;
            }
            foreach (Control ctr in this.panel13.Controls)
            {
                //判断该控件是不是CheckBox
                if (ctr is CheckBox)
                {
                    //将ctr转换成CheckBox并赋值给ck
                    CheckBox ck = ctr as CheckBox;
                    if (ck.Checked)
                    {
                        resident_base_infoBean.drug_allergy += "," + ck.Tag.ToString();;
                    }
                }
            }
            if (resident_base_infoBean.drug_allergy != null && resident_base_infoBean.drug_allergy != "")
            {
                resident_base_infoBean.drug_allergy = resident_base_infoBean.drug_allergy.Substring(1);
            }
            if (this.checkBox13.Checked)
            {
                resident_base_infoBean.allergy_other = this.textBox39.Text;
            }
            foreach (Control ctr in this.panel14.Controls)
            {
                //判断该控件是不是CheckBox
                if (ctr is CheckBox)
                {
                    //将ctr转换成CheckBox并赋值给ck
                    CheckBox ck = ctr as CheckBox;
                    if (ck.Checked)
                    {
                        resident_base_infoBean.exposure += "," + ck.Tag.ToString();
                    }
                }
            }
            if (resident_base_infoBean.exposure != null && resident_base_infoBean.exposure != "")
            {
                resident_base_infoBean.exposure = resident_base_infoBean.exposure.Substring(1);
            }
            if (this.radioButton48.Checked == true)
            {
                resident_base_infoBean.is_heredity = this.radioButton48.Tag.ToString();
            }
            ;
            if (this.radioButton47.Checked == true)
            {
                resident_base_infoBean.is_heredity   = this.radioButton47.Tag.ToString();
                resident_base_infoBean.heredity_name = this.textBox36.Text;
            }
            ;

            foreach (Control ctr in this.panel20.Controls)
            {
                //判断该控件是不是CheckBox
                if (ctr is CheckBox)
                {
                    //将ctr转换成CheckBox并赋值给ck
                    CheckBox ck = ctr as CheckBox;
                    if (ck.Checked)
                    {
                        resident_base_infoBean.is_deformity += "," + ck.Tag.ToString();
                    }
                }
            }
            if (resident_base_infoBean.is_deformity != null && resident_base_infoBean.is_deformity != "")
            {
                resident_base_infoBean.is_deformity = resident_base_infoBean.is_deformity.Substring(1);
                if (this.checkBox33.Checked)
                {
                    resident_base_infoBean.deformity_name = this.textBox37.Text;
                }
            }


            if (this.radioButton18.Checked == true)
            {
                resident_base_infoBean.kitchen = this.radioButton18.Tag.ToString();
            }
            ;
            if (this.radioButton19.Checked == true)
            {
                resident_base_infoBean.kitchen = this.radioButton19.Tag.ToString();
            }
            ;
            if (this.radioButton20.Checked == true)
            {
                resident_base_infoBean.kitchen = this.radioButton20.Tag.ToString();
            }
            ;
            if (this.radioButton21.Checked == true)
            {
                resident_base_infoBean.kitchen = this.radioButton21.Tag.ToString();
            }
            ;

            if (this.radioButton70.Checked == true)
            {
                resident_base_infoBean.fuel = this.radioButton70.Tag.ToString();
            }
            ;
            if (this.radioButton71.Checked == true)
            {
                resident_base_infoBean.fuel = this.radioButton71.Tag.ToString();
            }
            ;
            if (this.radioButton72.Checked == true)
            {
                resident_base_infoBean.fuel = this.radioButton72.Tag.ToString();
            }
            ;
            if (this.radioButton73.Checked == true)
            {
                resident_base_infoBean.fuel = this.radioButton73.Tag.ToString();
            }
            ;
            if (this.radioButton74.Checked == true)
            {
                resident_base_infoBean.fuel = this.radioButton74.Tag.ToString();
            }
            ;
            if (this.radioButton75.Checked == true)
            {
                resident_base_infoBean.fuel = this.radioButton75.Tag.ToString();
            }
            ;

            if (this.radioButton76.Checked == true)
            {
                resident_base_infoBean.drink = this.radioButton76.Tag.ToString();
            }
            ;
            if (this.radioButton77.Checked == true)
            {
                resident_base_infoBean.drink = this.radioButton77.Tag.ToString();
            }
            ;
            if (this.radioButton78.Checked == true)
            {
                resident_base_infoBean.drink = this.radioButton78.Tag.ToString();
            }
            ;
            if (this.radioButton79.Checked == true)
            {
                resident_base_infoBean.drink = this.radioButton79.Tag.ToString();
            }
            ;
            if (this.radioButton80.Checked == true)
            {
                resident_base_infoBean.drink = this.radioButton80.Tag.ToString();
            }
            ;
            if (this.radioButton81.Checked == true)
            {
                resident_base_infoBean.drink = this.radioButton81.Tag.ToString();
            }
            ;

            if (this.radioButton82.Checked == true)
            {
                resident_base_infoBean.toilet = this.radioButton82.Tag.ToString();
            }
            ;
            if (this.radioButton83.Checked == true)
            {
                resident_base_infoBean.toilet = this.radioButton83.Tag.ToString();
            }
            ;
            if (this.radioButton84.Checked == true)
            {
                resident_base_infoBean.toilet = this.radioButton84.Tag.ToString();
            }
            ;
            if (this.radioButton85.Checked == true)
            {
                resident_base_infoBean.toilet = this.radioButton85.Tag.ToString();
            }
            ;
            if (this.radioButton86.Checked == true)
            {
                resident_base_infoBean.toilet = this.radioButton86.Tag.ToString();
            }
            ;

            if (this.radioButton87.Checked == true)
            {
                resident_base_infoBean.poultry = this.radioButton87.Tag.ToString();
            }
            ;
            if (this.radioButton88.Checked == true)
            {
                resident_base_infoBean.poultry = this.radioButton88.Tag.ToString();
            }
            ;
            if (this.radioButton89.Checked == true)
            {
                resident_base_infoBean.poultry = this.radioButton89.Tag.ToString();
            }
            ;
            if (this.radioButton90.Checked == true)
            {
                resident_base_infoBean.poultry = this.radioButton90.Tag.ToString();
            }
            ;

            ////以下页面未用 数据库字段格式要求
            resident_base_infoBean.create_time     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            resident_base_infoBean.update_time     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            resident_base_infoBean.update_name     = frmLogin.name;
            resident_base_infoBean.create_name     = frmLogin.name;
            resident_base_infoBean.create_user     = frmLogin.userCode;
            resident_base_infoBean.is_hypertension = "0";   //是否高血压
            resident_base_infoBean.is_diabetes     = "0";   //是否糖尿病
            resident_base_infoBean.is_psychosis    = "0";   //是否精神病
            resident_base_infoBean.is_tuberculosis = "0";   //是否结核病

            ////resident_base_infoBean.is_deformity = "0";
            #region  高 糖 精 结 新的判断方法
            for (int i = 0; i < goodsList.Rows.Count; i++)
            {
                string tmp = goodsList.Rows[i]["disease_type"].ToString();
                switch (tmp)
                {
                case "2":
                    resident_base_infoBean.is_hypertension = "1";
                    break;

                case "3":
                    resident_base_infoBean.is_diabetes = "1";
                    break;

                case "8":
                    resident_base_infoBean.is_psychosis = "1";
                    break;

                case "9":
                    resident_base_infoBean.is_tuberculosis = "1";
                    break;
                }
            }
            #endregion
            //贫困户处理
            if (radpinkun0.Checked == true)
            {
                resident_base_infoBean.is_poor = "0";
            }
            if (radpinkun1.Checked == true)
            {
                resident_base_infoBean.is_poor = "1";
            }

            if (radioButton17.Checked == true)
            {
                resident_base_infoBean.is_signing = "0";
            }
            if (radioButton16.Checked == true)
            {
                resident_base_infoBean.is_signing = "1";
            }
            int intbian = 0;
            if (oldname != resident_base_infoBean.name)
            {
                intbian = 1;  //姓名改变
            }
            if (oldidnumber != resident_base_infoBean.id_number)
            {
                intbian = 2;   //身份证号改变
            }
            if (oldname != resident_base_infoBean.name && oldidnumber != resident_base_infoBean.id_number)
            {
                intbian = 3;   //两个都改变了
            }

            bool isfalse = personalBasicInfoService.aUpersonalBasicInfo(resident_base_infoBean, id, goodsList, goodsList0, goodsList1, goodsList2, goodsList3, intbian);
            if (isfalse)
            {
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show("保存失败");
            }
        }