public bool Update(HealthSelfCareabilityModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(" update HEALTHHOUSE_SELFCAREABILITY set ");
            //builder.Append("PID=@PID,");
            builder.Append("IDCardNo=@IDCardNo,");
            builder.Append("Dine=@Dine,");
            builder.Append("Groming=@Groming,");
            builder.Append("Dressing=@Dressing,");
            builder.Append("Tolet=@Tolet,");
            builder.Append("Activity=@Activity,");
            builder.Append("TotalScore=@TotalScore,");
            builder.Append("CreatedBy=@CreatedBy,");
            builder.Append("CreatedDate=@CreatedDate,");
            builder.Append("LastUpDateBy=@LastUpDateBy,");
            builder.Append("LastUpDateDate=@LastUpDateDate");
            builder.Append(" where PID=@PID");
            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@PID", MySqlDbType.Int32),
                new MySqlParameter("@IDCardNo", MySqlDbType.String),
                new MySqlParameter("@Dine", MySqlDbType.Decimal),
                new MySqlParameter("@Groming", MySqlDbType.Decimal),
                new MySqlParameter("@Dressing", MySqlDbType.Decimal),
                new MySqlParameter("@Tolet", MySqlDbType.Decimal),
                new MySqlParameter("@Activity", MySqlDbType.Decimal),
                new MySqlParameter("@TotalScore", MySqlDbType.Decimal),
                new MySqlParameter("@CreatedBy", MySqlDbType.String),
                new MySqlParameter("@CreatedDate", MySqlDbType.Date),
                new MySqlParameter("@LastUpDateBy", MySqlDbType.String),
                new MySqlParameter("@LastUpDateDate", MySqlDbType.Date)
            };
            cmdParms[0].Value  = model.PID;
            cmdParms[1].Value  = model.IDCardNo;
            cmdParms[2].Value  = model.Dine;
            cmdParms[3].Value  = model.Groming;
            cmdParms[4].Value  = model.Dressing;
            cmdParms[5].Value  = model.Tolet;
            cmdParms[6].Value  = model.Activity;
            cmdParms[7].Value  = model.TotalScore;
            cmdParms[8].Value  = model.CreatedBy;
            cmdParms[9].Value  = model.CreatedDate;
            cmdParms[10].Value = model.LastUpDateBy;
            cmdParms[11].Value = model.LastUpDateDate;
            //cmdParms[12].Value = model.PID;
            return(MySQLHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
        public int Add(HealthSelfCareabilityModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(" insert into HEALTHHOUSE_SELFCAREABILITY(");
            builder.Append("PID,IDCardNo,Dine,Groming,Dressing,Tolet,Activity,TotalScore,CreatedBy,CreatedDate,LastUpDateBy,LastUpDateDate)");
            builder.Append(" values (");
            builder.Append("@PID,@IDCardNo,@Dine,@Groming,@Dressing,@Tolet,@Activity,@TotalScore,@CreatedBy,@CreatedDate,@LastUpDateBy,@LastUpDateDate)");
            builder.Append(";select @@IDENTITY");
            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@PID", MySqlDbType.Int32),
                new MySqlParameter("@IDCardNo", MySqlDbType.String),
                new MySqlParameter("@Dine", MySqlDbType.Decimal),
                new MySqlParameter("@Groming", MySqlDbType.Decimal),
                new MySqlParameter("@Dressing", MySqlDbType.Decimal),
                new MySqlParameter("@Tolet", MySqlDbType.Decimal),
                new MySqlParameter("@Activity", MySqlDbType.Decimal),
                new MySqlParameter("@TotalScore", MySqlDbType.Decimal),
                new MySqlParameter("@CreatedBy", MySqlDbType.String),
                new MySqlParameter("@CreatedDate", MySqlDbType.Date),
                new MySqlParameter("@LastUpDateBy", MySqlDbType.String),
                new MySqlParameter("@LastUpDateDate", MySqlDbType.Date)
            };
            cmdParms[0].Value  = model.PID;
            cmdParms[1].Value  = model.IDCardNo;
            cmdParms[2].Value  = model.Dine;
            cmdParms[3].Value  = model.Groming;
            cmdParms[4].Value  = model.Dressing;
            cmdParms[5].Value  = model.Tolet;
            cmdParms[6].Value  = model.Activity;
            cmdParms[7].Value  = model.TotalScore;
            cmdParms[8].Value  = model.CreatedBy;
            cmdParms[9].Value  = model.CreatedDate;
            cmdParms[10].Value = model.LastUpDateBy;
            cmdParms[11].Value = model.LastUpDateDate;
            object single = MySQLHelper.GetSingle(builder.ToString(), cmdParms);

            if (single == null)
            {
                return(0);
            }
            return(Convert.ToInt32(single));
        }
Example #3
0
 public void InitEveryThing()
 {
     if (this.HelderSelf == null)
     {
         HealthSelfCareabilityModel olderSelfCareabilityModel = new HealthSelfCareabilityModel
         {
             IDCardNo    = this.Model.IDCardNo,
             Dine        = 0,
             Groming     = 0,
             Dressing    = 0,
             Tolet       = 0,
             Activity    = 0,
             CreatedDate = new DateTime?(DateTime.Today)
         };
         this.HelderSelf           = olderSelfCareabilityModel;
         this.HelderSelf.CreatedBy = ConfigHelper.GetNode("doctorName");
     }
     else
     {
         this.HelderSelf.LastUpDateBy   = ConfigHelper.GetNode("doctorName");
         this.HelderSelf.LastUpDateDate = new DateTime?(DateTime.Today);
     }
     this.cp_elderSelf = GlbTools.DeepCopy(this.HelderSelf);
     this.CbSimpleBind(this.cbDinner, "DINE");
     this.CbSimpleBind(this.cbGromming, "Groming");
     this.CbSimpleBind(this.cbDressing, "Dressing");
     this.CbSimpleBind(this.cbTolet, "Tolet");
     this.CbSimpleBind(this.cbAct, "Activity");
     if (this.HelderSelf.TotalScore.HasValue)
     {
         this.tbTotal.Text = this.HelderSelf.TotalScore.Value.ToString();
     }
     else
     {
         this.tbTotal.Text = "0";
     }
     MustChoose();
     this.EveryThingIsOk = true;
 }
        public void InitEveryThing()
        {
            this.AExamModel = new HealthAssessExamBLL().GetModel(HealthAssessFactory.ID);
            if (this.AExamModel == null)
            {
                this.AExamModel = new HealthAssessExamModel {
                    IDCardNo = this.Model.IDCardNo
                };
            }

            // 获取病人是否有健康指导
            HealthHouseModel     houseModel = new HealthHouseBLL().GetMaxData(this.Model.IDCardNo);
            RecordsBaseInfoModel baseInfo   = new RecordsBaseInfoBLL().GetModel(this.Model.IDCardNo); // 体检人基本信息

            this.lbName.Text = baseInfo.CustomerName;
            this.lbData.Text = houseModel.CheckDate.Value.ToString("yyyy-MM-dd");
            this.lblAge.Text = timeParser.GetAge(baseInfo.Birthday);
            this.lblSex.Text = StringPlus.GetSex(baseInfo.Sex);

            CMoreChange change = new CMoreChange
            {
                MoreChange    = this.cbFamilySick,
                Name          = "家庭疾病史",
                Unusual       = "无",
                Other         = this.tbFamilySick,
                MaxBytesCount = 200
            };

            this.jzjbs = change;
            this.jzjbs.TransInfo(this.AExamModel.FamilyHistory, this.AExamModel.FamilyOther);
            CMoreChange change1 = new CMoreChange
            {
                MoreChange    = this.cbSick,
                Name          = "疾病史",
                Unusual       = "无",
                Other         = this.tbcbSick,
                MaxBytesCount = 200
            };

            this.jbs = change1;
            this.jbs.TransInfo(this.AExamModel.MedicalHistory, this.AExamModel.MedicalOther);
            CMoreChange change3 = new CMoreChange
            {
                MoreChange    = this.cbdlfs,
                Name          = "锻炼方式",
                Other         = this.tbdlfs,
                MaxBytesCount = 200
            };

            this.dlfs = change3;
            this.dlfs.TransInfo(this.AExamModel.ExerciseExistense, this.AExamModel.ExerciseExistenseOther);

            this.bindingManager = new SimpleBindingManager <HealthAssessExamModel>(this.inputRanges, this.inputrange_str,
                                                                                   this.AExamModel);
            this.bindingManager.SimpleBinding(this.txtMint, "ExerciseTimes", true);
            this.bindingManager.SimpleBinding(this.tbScore, "GloomyScore", true);
            this.bindingManager.SimpleBinding(this.tbDietOther, "DietaryOther", false);

            SetCom(this.cbDietCout, this.AExamModel.DietaryNum);
            SetCom(this.cbDietRe, this.AExamModel.DietaryLaw);
            SetCom(this.cmbduanlianpinlv, this.AExamModel.ExerciseRate);
            SetCom(this.cbzys, this.AExamModel.HospitalHistory);
            SetCom(this.cbfy, this.AExamModel.TakingMedicine);
            SetCom(this.cmbzilinengli, this.AExamModel.OldSelfCareability);

            this.TransHabit();//饮食习惯

            if (this.Model.PopulationType.Contains("4"))
            {
                this.gpOld.Enabled = true;
            }
            else
            {
                this.gpOld.Enabled = false;
            }

            //老年人自理能力
            this.HSelfModel     = new HealthSelfCareabilityBLL().GetModel(this.AExamModel.PID);
            this.EveryThingIsOk = true;
        }
Example #5
0
 public bool Update(HealthSelfCareabilityModel model)
 {
     return(this.dal.Update(model));
 }
Example #6
0
 public int Add(HealthSelfCareabilityModel model)
 {
     return(this.dal.Add(model));
 }