コード例 #1
0
        public int Add(HealthAssessModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(" insert into tbl_hhhealthassess(");
            builder.Append("PID,IDCardNo,BasicTest,Blood,PulseRate,Oxygen,Urine,ChestX,BSuper,ECG,Cardiovascular,Lung,Bone,TCMConstitution,Overview,CreateDate,CreateBy,UpdateDate,UpdataBy,CheckDate)");
            builder.Append(" values( ");
            builder.Append("@PID,@IDCardNo,@BasicTest,@Blood,@PulseRate,@Oxygen,@Urine,@ChestX,@BSuper,@ECG,@Cardiovascular,@Lung,@Bone,@TCMConstitution,@Overview,@CreateDate,@CreateBy,@UpdateDate,@UpdataBy,@CheckDate)");
            builder.Append(";select @@IDENTITY");
            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@PID", MySqlDbType.Int32),
                new MySqlParameter("@IDCardNo", MySqlDbType.String),
                new MySqlParameter("@BasicTest", MySqlDbType.String),
                new MySqlParameter("@Blood", MySqlDbType.String),
                new MySqlParameter("@PulseRate", MySqlDbType.String),
                new MySqlParameter("@Oxygen", MySqlDbType.String),
                new MySqlParameter("@Urine", MySqlDbType.String),
                new MySqlParameter("@ChestX", MySqlDbType.String),
                new MySqlParameter("@BSuper", MySqlDbType.String),
                new MySqlParameter("@ECG", MySqlDbType.String),
                new MySqlParameter("@Cardiovascular", MySqlDbType.String),
                new MySqlParameter("@Lung", MySqlDbType.String),
                new MySqlParameter("@Bone", MySqlDbType.String),
                new MySqlParameter("@TCMConstitution", MySqlDbType.String),
                new MySqlParameter("@Overview", MySqlDbType.String),
                new MySqlParameter("@CreateDate", MySqlDbType.Date),
                new MySqlParameter("@CreateBy", MySqlDbType.String),
                new MySqlParameter("@UpdateDate", MySqlDbType.Date),
                new MySqlParameter("@UpdataBy", MySqlDbType.String),
                new MySqlParameter("@CheckDate", MySqlDbType.Date)
            };
            cmdParms[0].Value  = model.PID;
            cmdParms[1].Value  = model.IDCardNo;
            cmdParms[2].Value  = model.BasicTest;
            cmdParms[3].Value  = model.Blood;
            cmdParms[4].Value  = model.PulseRate;
            cmdParms[5].Value  = model.Oxygen;
            cmdParms[6].Value  = model.Urine;
            cmdParms[7].Value  = model.ChestX;
            cmdParms[8].Value  = model.BSuper;
            cmdParms[9].Value  = model.ECG;
            cmdParms[10].Value = model.Cardiovascular;
            cmdParms[11].Value = model.Lung;
            cmdParms[12].Value = model.Bone;
            cmdParms[13].Value = model.TCMConstitution;
            cmdParms[14].Value = model.Overview;
            cmdParms[15].Value = model.CreateDate;
            cmdParms[16].Value = model.CreateBy;
            cmdParms[17].Value = model.UpdateDate;
            cmdParms[18].Value = model.UpdataBy;
            cmdParms[19].Value = model.CheckDate;

            object single = MySQLHelper.GetSingle(builder.ToString(), cmdParms);

            if (single == null)
            {
                return(0);
            }
            return(Convert.ToInt32(single));
        }
コード例 #2
0
        public void InitEveryThing()
        {
            HealthHouseModel houseModel = new HealthHouseModel();

            if (HealthAssessFactory.ID == 0)//新增时
            {
                houseModel             = healthHouseBLL.GetMaxData(this.Model.IDCardNo);
                HealthAssessFactory.ID = houseModel.ID;
            }
            else //查询时
            {
                houseModel = healthHouseBLL.GetDataByID(HealthAssessFactory.ID);
            }

            this.AssessModel = new HealthAssessModel {
                IDCardNo = this.Model.IDCardNo
            };
            List <HealthOverviewSetModel> SetList = new List <HealthOverviewSetModel>();

            SetList = new HealthOverviewSetBLL().GetList(" and Type in (1,2,3,4) ");

            if (houseModel != null)
            {
                HealthAssessFactory.ID     = houseModel.ID;
                this.AssessModel.PID       = houseModel.ID;
                this.AssessModel.CheckDate = houseModel.CheckDate;

                this.lbBMI.Text     = houseModel.BMI.ToString();         //体质指数
                this.lbXueYa.Text   = "收缩压:" + houseModel.LeftHeight.ToString();
                this.lbxinlv.Text   = houseModel.PulseRate.ToString();   //心率
                this.lbxueyang.Text = houseModel.BloodOxygen.ToString(); //血氧

                if (SetList == null)
                {
                    this.AssessModel.BasicTest = "";
                    this.AssessModel.Blood     = "";
                    this.AssessModel.PulseRate = "";
                    this.AssessModel.Oxygen    = "";
                    this.AssessModel.Urine     = "";
                }
                else
                {
                    foreach (HealthOverviewSetModel hs in SetList)
                    {
                        if (hs.Type == "1")//体质指数
                        {
                            this.lbBMI.Text += "  参考范围:" + hs.minValues + " ~ " + hs.maxValues;
                            int res = Compare(houseModel.BMI.ToString(), hs.maxValues, hs.minValues);
                            if (res == 2 || res == 1)
                            {
                                this.lbBMI.ForeColor = Color.Red;
                            }
                        }
                        else if (hs.Type == "2")//血压
                        {
                            string[] Hmax = hs.maxValues.Split('/');
                            string[] Hmin = hs.minValues.Split('/');
                            bool     flag = false;

                            if (Hmax.Length == 2)
                            {
                                this.lbXueYa.Text += "  参考范围:" + Hmax[0] + " ~  " + Hmax[1];
                                if (Compare(houseModel.LeftHeight.ToString(), Hmax[0], Hmax[1]) == 1)
                                {
                                    this.lbXueYa.ForeColor = Color.Red;
                                }
                            }
                            this.lbXueYa.Text += "    舒张压:" + houseModel.LeftPre.ToString() + "   ";
                            if (Hmin.Length == 2)
                            {
                                this.lbXueYa.Text += "  参考范围:" + Hmin[0] + " ~  " + Hmin[1];
                                if (Compare(houseModel.LeftPre.ToString(), Hmin[0], Hmin[1]) == 2)
                                {
                                    this.lbXueYa.ForeColor = Color.Red;
                                }
                            }
                        }
                        else if (hs.Type == "3")//心率
                        {
                            this.lbxinlv.Text += "  参考范围:" + hs.maxValues + " ~  " + hs.minValues;
                            int res = Compare(houseModel.PulseRate.ToString(), hs.maxValues, hs.minValues);
                            if (res == 2 || res == 1)
                            {
                                this.lbxinlv.ForeColor = Color.Red;
                            }
                        }
                        else if (hs.Type == "4")//血氧
                        {
                            this.lbxueyang.Text += "  参考范围:" + hs.maxValues + " ~  " + hs.minValues;
                            int res = Compare(houseModel.BloodOxygen.ToString(), hs.maxValues, hs.minValues);

                            if (res == 2 || res == 1)
                            {
                                this.lbxueyang.ForeColor = Color.Red;
                                this.AssessModel.Oxygen  = "偏低";
                            }
                        }
                    }
                }
                HealthHousePhysicalAssistCheckModel HHAssistCheck = new HealthHousePhysicalAssistCheckBLL().GetModel(houseModel.ID);//辅助检查表
                if (HHAssistCheck != null)
                {
                    if (HHAssistCheck.CHESTX == "1")
                    {
                        this.lbXiongBu.Text = "正常";
                    }
                    else if (HHAssistCheck.CHESTX == "2")
                    {
                        this.lbXiongBu.ForeColor = Color.Red;
                        this.lbXiongBu.Text      = "异常";
                    }
                    if (!string.IsNullOrEmpty(HHAssistCheck.PRO) &&
                        !string.IsNullOrEmpty(HHAssistCheck.GLU) &&
                        !string.IsNullOrEmpty(HHAssistCheck.KET) &&
                        !string.IsNullOrEmpty(HHAssistCheck.BLD))
                    {
                        if (HHAssistCheck.PRO.Contains("+") ||
                            HHAssistCheck.GLU.Contains("+") ||
                            HHAssistCheck.KET.Contains("+") ||
                            HHAssistCheck.BLD.Contains("+"))
                        {
                            this.lbniao.ForeColor = Color.Red;
                            this.lbniao.Text      = "异常";
                        }
                        else
                        {
                            this.lbniao.Text = "正常";
                        }
                    }
                }
                HealthHouseBCHAOModel BchaoModel = new HealthHouseBCHAOBLL().GetModel(houseModel.ID);//B超表
                if (BchaoModel != null)
                {
                    if (BchaoModel.BCHAO == "1")
                    {
                        this.lbBchao.Text = "正常";
                    }
                    else if (BchaoModel.BCHAO == "2")
                    {
                        this.lbBchao.ForeColor = Color.Red;
                        this.lbBchao.Text      = "异常";
                    }
                }
                HealthHouseEcgModel EcgModel = new HealthHouseEcgBLL().GetModel(houseModel.ID);//心电
                if (EcgModel != null)
                {
                    if (EcgModel.ECG == "1")
                    {
                        this.lbEcg.Text = "正常";
                    }
                    else if (EcgModel.ECG == "2")
                    {
                        this.lbEcg.ForeColor = Color.Red;
                        this.lbEcg.Text      = "异常";
                    }
                }
                HHCardiovascularModel VascularModel = new HHCardiovascularBLL().GetData(this.Model.IDCardNo, houseModel.ID);//心血管
                if (VascularModel != null)
                {
                    if (VascularModel.Result == "1")
                    {
                        this.lbVascular.Text = "正常";
                    }
                    else if (VascularModel.Result == "2")
                    {
                        this.lbVascular.ForeColor = Color.Red;
                        this.lbVascular.Text      = "异常";
                    }
                }
                HHBoneModel BoneModel = new HHBoneBLL().GetData(this.Model.IDCardNo, houseModel.ID);//骨密度
                if (BoneModel != null)
                {
                    if (BoneModel.Result == "1")
                    {
                        this.lbBone.Text = "正常";
                    }
                    else if (BoneModel.Result == "2")
                    {
                        this.lbBone.ForeColor = Color.Red;
                        this.lbBone.Text      = "异常";
                    }
                }
                HHLungModel LungModel = new HHLungBLL().GetData(this.Model.IDCardNo, houseModel.ID);//肺功能
                if (LungModel != null)
                {
                    if (LungModel.Result == "1")
                    {
                        this.lbLung.Text = "正常";
                    }
                    else if (LungModel.Result == "2")
                    {
                        this.lbLung.ForeColor = Color.Red;
                        this.lbLung.Text      = "异常";
                    }
                }
                HealthHouseMediPhyModel MedModel = new HealthHouseMediPhyBLL().GetModel(houseModel.ID);//中医体质类型
                if (MedModel != null)
                {
                    string strMed = "";
                    if (!string.IsNullOrEmpty(MedModel.Mild))
                    {
                        strMed += "平和质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Faint))
                    {
                        strMed += "气虚质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Yang))
                    {
                        strMed += "阳虚质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Yin))
                    {
                        strMed += "阴虚质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.PhlegmDamp))
                    {
                        strMed += "痰湿质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Muggy))
                    {
                        strMed += "湿热质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.BloodStasis))
                    {
                        strMed += "血瘀质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.QiConstraint))
                    {
                        strMed += "气郁质,";
                    }
                    if (!string.IsNullOrEmpty(MedModel.Characteristic))
                    {
                        strMed += "特兼质,";
                    }
                    if (strMed != "")
                    {
                        this.lbMed.Text = strMed.Remove(strMed.Length - 1, 1);
                    }
                }
            }
            else
            {
                MessageBox.Show("无体检信息,请先做体检!");
                return;
            }
            //SimpleBinding(this.lbBMI, "BasicTest");
            //SimpleBinding(this.lbData, "CheckDate");
            //SimpleBinding(this.lbXueYa, "Blood");
            //SimpleBinding(this.lbBchao, "BSuper");
            //SimpleBinding(this.lbXiongBu, "ChestX");
            //SimpleBinding(this.lbEcg, "ECG");
            //SimpleBinding(this.lbVascular, "Cardiovascular");
            //SimpleBinding(this.lbBone, "Bone");
            //SimpleBinding(this.lbLung, "Lung");
            //SimpleBinding(this.lbMed, "TCMConstitution");
            //SimpleBinding(this.lbxinlv, "PulseRate");
            //SimpleBinding(this.lbxueyang, "Oxygen");
            //SimpleBinding(this.lbniao, "Urine");
            this.EveryThingIsOk = true;
        }
コード例 #3
0
 public bool Update(HealthAssessModel model)
 {
     return(this.dal.Update(model));
 }
コード例 #4
0
        public bool Update(HealthAssessModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(" update tbl_hhhealthassess set ");
            builder.Append("PID=@PID,");
            builder.Append("IDCardNo=@IDCardNo,");
            builder.Append("BasicTest=@BasicTest,");
            builder.Append("Blood=@Blood,");
            builder.Append("PulseRate=@PulseRate,");
            builder.Append("Oxygen=@Oxygen,");
            builder.Append("Urine=@Urine,");
            builder.Append("ChestX=@ChestX,");
            builder.Append("BSuper=@BSuper,");
            builder.Append("ECG=@ECG,");
            builder.Append("Cardiovascular=@Cardiovascular,");
            builder.Append("Lung=@Lung,");
            builder.Append("Bone=@Bone,");
            builder.Append("TCMConstitution=@TCMConstitution,");
            builder.Append("Overview=@Overview,");
            builder.Append("CreateDate=@CreateDate,");
            builder.Append("CreateBy=@CreateBy,");
            builder.Append("UpdateDate=@UpdateDate,");
            builder.Append("UpdataBy=@UpdataBy,");
            builder.Append("CheckDate=@CheckDate");
            builder.Append(" where ID=@ID");
            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@PID", MySqlDbType.Int32),
                new MySqlParameter("@IDCardNo", MySqlDbType.String),
                new MySqlParameter("@BasicTest", MySqlDbType.String),
                new MySqlParameter("@Blood", MySqlDbType.String),
                new MySqlParameter("@PulseRate", MySqlDbType.String),
                new MySqlParameter("@Oxygen", MySqlDbType.String),
                new MySqlParameter("@Urine", MySqlDbType.String),
                new MySqlParameter("@ChestX", MySqlDbType.String),
                new MySqlParameter("@BSuper", MySqlDbType.String),
                new MySqlParameter("@ECG", MySqlDbType.String),
                new MySqlParameter("@Cardiovascular", MySqlDbType.String),
                new MySqlParameter("@Lung", MySqlDbType.String),
                new MySqlParameter("@Bone", MySqlDbType.String),
                new MySqlParameter("@TCMConstitution", MySqlDbType.String),
                new MySqlParameter("@Overview", MySqlDbType.String),
                new MySqlParameter("@CreateDate", MySqlDbType.Date),
                new MySqlParameter("@CreateBy", MySqlDbType.String),
                new MySqlParameter("@UpdateDate", MySqlDbType.Date),
                new MySqlParameter("@UpdataBy", MySqlDbType.String),
                new MySqlParameter("@CheckDate", MySqlDbType.Date),
                new MySqlParameter("@ID", MySqlDbType.Int32)
            };
            cmdParms[0].Value  = model.PID;
            cmdParms[1].Value  = model.IDCardNo;
            cmdParms[2].Value  = model.BasicTest;
            cmdParms[3].Value  = model.Blood;
            cmdParms[4].Value  = model.PulseRate;
            cmdParms[5].Value  = model.Oxygen;
            cmdParms[6].Value  = model.Urine;
            cmdParms[7].Value  = model.ChestX;
            cmdParms[8].Value  = model.BSuper;
            cmdParms[9].Value  = model.ECG;
            cmdParms[10].Value = model.Cardiovascular;
            cmdParms[11].Value = model.Lung;
            cmdParms[12].Value = model.Bone;
            cmdParms[13].Value = model.TCMConstitution;
            cmdParms[14].Value = model.Overview;
            cmdParms[15].Value = model.CreateDate;
            cmdParms[16].Value = model.CreateBy;
            cmdParms[17].Value = model.UpdateDate;
            cmdParms[18].Value = model.UpdataBy;
            cmdParms[19].Value = model.CheckDate;
            cmdParms[20].Value = model.ID;
            return(MySQLHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
コード例 #5
0
 public int Add(HealthAssessModel model)
 {
     return(this.dal.Add(model));
 }