示例#1
0
        public bool Update(OlderMedicineCnModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update OLD_MEDICINE_CN set ");
            builder.Append("RecordID=@RecordID,");
            builder.Append("IDCardNo=@IDCardNo,");
            builder.Append("CustomerID=@CustomerID,");
            builder.Append("PhysicalID=@PhysicalID,");
            builder.Append("Energy=@Energy,");
            builder.Append("Tired=@Tired,");
            builder.Append("Breath=@Breath,");
            builder.Append("Voice=@Voice,");
            builder.Append("Emotion=@Emotion,");
            builder.Append("Spirit=@Spirit,");
            builder.Append("Alone=@Alone,");
            builder.Append("Fear=@Fear,");
            builder.Append("Weight=@Weight,");
            builder.Append("Eye=@Eye,");
            builder.Append("FootHand=@FootHand,");
            builder.Append("Stomach=@Stomach,");
            builder.Append("Cold=@Cold,");
            builder.Append("Influenza=@Influenza,");
            builder.Append("Nasal=@Nasal,");
            builder.Append("Snore=@Snore,");
            builder.Append("Allergy=@Allergy,");
            builder.Append("Urticaria=@Urticaria,");
            builder.Append("Skin=@Skin,");
            builder.Append("Scratch=@Scratch,");
            builder.Append("Mouth=@Mouth,");
            builder.Append("Arms=@Arms,");
            builder.Append("Greasy=@Greasy,");
            builder.Append("Spot=@Spot,");
            builder.Append("Eczema=@Eczema,");
            builder.Append("Thirsty=@Thirsty,");
            builder.Append("Smell=@Smell,");
            builder.Append("Abdomen=@Abdomen,");
            builder.Append("Coolfood=@Coolfood,");
            builder.Append("Defecate=@Defecate,");
            builder.Append("Defecatedry=@Defecatedry,");
            builder.Append("Tongue=@Tongue,");
            builder.Append("Vein=@Vein,");
            builder.Append("CreatedBy=@CreatedBy,");
            builder.Append("CreatedDate=@CreatedDate,");
            builder.Append("LastUpdateBy=@LastUpdateBy,");
            builder.Append("LastUpdateDate=@LastUpdateDate,");
            builder.Append("FollowUpDoctor=@FollowUpDoctor,");
            builder.Append("RecordDate=@RecordDate,");
            builder.Append("IsDel=@IsDel");
            builder.Append(" where OUTkey=@OUTkey");
            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@RecordID", MySqlDbType.String, 17),
                new MySqlParameter("@IDCardNo", MySqlDbType.String, 21),
                new MySqlParameter("@CustomerID", MySqlDbType.String, 17),
                new MySqlParameter("@PhysicalID", MySqlDbType.String, 17),
                new MySqlParameter("@Energy", MySqlDbType.Decimal),
                new MySqlParameter("@Tired", MySqlDbType.Decimal),
                new MySqlParameter("@Breath", MySqlDbType.Decimal),
                new MySqlParameter("@Voice", MySqlDbType.Decimal),
                new MySqlParameter("@Emotion", MySqlDbType.Decimal),
                new MySqlParameter("@Spirit", MySqlDbType.Decimal),
                new MySqlParameter("@Alone", MySqlDbType.Decimal),
                new MySqlParameter("@Fear", MySqlDbType.Decimal),
                new MySqlParameter("@Weight", MySqlDbType.Decimal),
                new MySqlParameter("@Eye", MySqlDbType.Decimal),
                new MySqlParameter("@FootHand", MySqlDbType.Decimal),
                new MySqlParameter("@Stomach", MySqlDbType.Decimal),
                new MySqlParameter("@Cold", MySqlDbType.Decimal),
                new MySqlParameter("@Influenza", MySqlDbType.Decimal),
                new MySqlParameter("@Nasal", MySqlDbType.Decimal),
                new MySqlParameter("@Snore", MySqlDbType.Decimal),
                new MySqlParameter("@Allergy", MySqlDbType.Decimal),
                new MySqlParameter("@Urticaria", MySqlDbType.Decimal),
                new MySqlParameter("@Skin", MySqlDbType.Decimal),
                new MySqlParameter("@Scratch", MySqlDbType.Decimal),
                new MySqlParameter("@Mouth", MySqlDbType.Decimal),
                new MySqlParameter("@Arms", MySqlDbType.Decimal),
                new MySqlParameter("@Greasy", MySqlDbType.Decimal),
                new MySqlParameter("@Spot", MySqlDbType.Decimal),
                new MySqlParameter("@Eczema", MySqlDbType.Decimal),
                new MySqlParameter("@Thirsty", MySqlDbType.Decimal),
                new MySqlParameter("@Smell", MySqlDbType.Decimal),
                new MySqlParameter("@Abdomen", MySqlDbType.Decimal),
                new MySqlParameter("@Coolfood", MySqlDbType.Decimal),
                new MySqlParameter("@Defecate", MySqlDbType.Decimal),
                new MySqlParameter("@Defecatedry", MySqlDbType.Decimal),
                new MySqlParameter("@Tongue", MySqlDbType.Decimal),
                new MySqlParameter("@Vein", MySqlDbType.Decimal),
                new MySqlParameter("@CreatedBy", MySqlDbType.Decimal),
                new MySqlParameter("@CreatedDate", MySqlDbType.Date),
                new MySqlParameter("@LastUpdateBy", MySqlDbType.Decimal),
                new MySqlParameter("@LastUpdateDate", MySqlDbType.Date),
                new MySqlParameter("@FollowUpDoctor", MySqlDbType.String, 20),
                new MySqlParameter("@RecordDate", MySqlDbType.Date),
                new MySqlParameter("@IsDel", MySqlDbType.String, 1),
                new MySqlParameter("@OUTkey", MySqlDbType.Int32, 8)
            };
            cmdParms[0].Value  = model.RecordID;
            cmdParms[1].Value  = model.IDCardNo;
            cmdParms[2].Value  = model.CustomerID;
            cmdParms[3].Value  = model.PhysicalID;
            cmdParms[4].Value  = model.Energy;
            cmdParms[5].Value  = model.Tired;
            cmdParms[6].Value  = model.Breath;
            cmdParms[7].Value  = model.Voice;
            cmdParms[8].Value  = model.Emotion;
            cmdParms[9].Value  = model.Spirit;
            cmdParms[10].Value = model.Alone;
            cmdParms[11].Value = model.Fear;
            cmdParms[12].Value = model.Weight;
            cmdParms[13].Value = model.Eye;
            cmdParms[14].Value = model.FootHand;
            cmdParms[15].Value = model.Stomach;
            cmdParms[16].Value = model.Cold;
            cmdParms[17].Value = model.Influenza;
            cmdParms[18].Value = model.Nasal;
            cmdParms[19].Value = model.Snore;
            cmdParms[20].Value = model.Allergy;
            cmdParms[21].Value = model.Urticaria;
            cmdParms[22].Value = model.Skin;
            cmdParms[23].Value = model.Scratch;
            cmdParms[24].Value = model.Mouth;
            cmdParms[25].Value = model.Arms;
            cmdParms[26].Value = model.Greasy;
            cmdParms[27].Value = model.Spot;
            cmdParms[28].Value = model.Eczema;
            cmdParms[29].Value = model.Thirsty;
            cmdParms[30].Value = model.Smell;
            cmdParms[31].Value = model.Abdomen;
            cmdParms[32].Value = model.Coolfood;
            cmdParms[33].Value = model.Defecate;
            cmdParms[34].Value = model.Defecatedry;
            cmdParms[35].Value = model.Tongue;
            cmdParms[36].Value = model.Vein;
            cmdParms[37].Value = model.CreatedBy;
            cmdParms[38].Value = model.CreatedDate;
            cmdParms[39].Value = model.LastUpdateBy;
            cmdParms[40].Value = model.LastUpdateDate;
            cmdParms[41].Value = model.FollowUpDoctor;
            cmdParms[42].Value = model.RecordDate;
            cmdParms[43].Value = model.IsDel;
            cmdParms[44].Value = model.OUTkey;
            return(MySQLHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
        public OlderMedicineCnModel DataRowToModel(DataRow row)
        {
            OlderMedicineCnModel records_medicine_cn = new OlderMedicineCnModel();

            if (row != null)
            {
                if (((row["ID"] != null) && (row["ID"] != DBNull.Value)) && (row["ID"].ToString() != ""))
                {
                    records_medicine_cn.ID = int.Parse(row["ID"].ToString());
                }
                if ((row["IDCardNo"] != null) && (row["IDCardNo"] != DBNull.Value))
                {
                    records_medicine_cn.IDCardNo = row["IDCardNo"].ToString();
                }
                if (((row["Energy"] != null) && (row["Energy"] != DBNull.Value)) && (row["Energy"].ToString() != ""))
                {
                    records_medicine_cn.Energy = new decimal?(decimal.Parse(row["Energy"].ToString()));
                }
                if (((row["Tired"] != null) && (row["Tired"] != DBNull.Value)) && (row["Tired"].ToString() != ""))
                {
                    records_medicine_cn.Tired = new decimal?(decimal.Parse(row["Tired"].ToString()));
                }
                if (((row["Breath"] != null) && (row["Breath"] != DBNull.Value)) && (row["Breath"].ToString() != ""))
                {
                    records_medicine_cn.Breath = new decimal?(decimal.Parse(row["Breath"].ToString()));
                }
                if (((row["Voice"] != null) && (row["Voice"] != DBNull.Value)) && (row["Voice"].ToString() != ""))
                {
                    records_medicine_cn.Voice = new decimal?(decimal.Parse(row["Voice"].ToString()));
                }
                if (((row["Emotion"] != null) && (row["Emotion"] != DBNull.Value)) && (row["Emotion"].ToString() != ""))
                {
                    records_medicine_cn.Emotion = new decimal?(decimal.Parse(row["Emotion"].ToString()));
                }
                if (((row["Spirit"] != null) && (row["Spirit"] != DBNull.Value)) && (row["Spirit"].ToString() != ""))
                {
                    records_medicine_cn.Spirit = new decimal?(decimal.Parse(row["Spirit"].ToString()));
                }
                if (((row["Alone"] != null) && (row["Alone"] != DBNull.Value)) && (row["Alone"].ToString() != ""))
                {
                    records_medicine_cn.Alone = new decimal?(decimal.Parse(row["Alone"].ToString()));
                }
                if (((row["Fear"] != null) && (row["Fear"] != DBNull.Value)) && (row["Fear"].ToString() != ""))
                {
                    records_medicine_cn.Fear = new decimal?(decimal.Parse(row["Fear"].ToString()));
                }
                if (((row["Weight"] != null) && (row["Weight"] != DBNull.Value)) && (row["Weight"].ToString() != ""))
                {
                    records_medicine_cn.Weight = new decimal?(decimal.Parse(row["Weight"].ToString()));
                }
                if (((row["Eye"] != null) && (row["Eye"] != DBNull.Value)) && (row["Eye"].ToString() != ""))
                {
                    records_medicine_cn.Eye = new decimal?(decimal.Parse(row["Eye"].ToString()));
                }
                if (((row["FootHand"] != null) && (row["FootHand"] != DBNull.Value)) && (row["FootHand"].ToString() != ""))
                {
                    records_medicine_cn.FootHand = new decimal?(decimal.Parse(row["FootHand"].ToString()));
                }
                if (((row["Stomach"] != null) && (row["Stomach"] != DBNull.Value)) && (row["Stomach"].ToString() != ""))
                {
                    records_medicine_cn.Stomach = new decimal?(decimal.Parse(row["Stomach"].ToString()));
                }
                if (((row["Cold"] != null) && (row["Cold"] != DBNull.Value)) && (row["Cold"].ToString() != ""))
                {
                    records_medicine_cn.Cold = new decimal?(decimal.Parse(row["Cold"].ToString()));
                }
                if (((row["Influenza"] != null) && (row["Influenza"] != DBNull.Value)) && (row["Influenza"].ToString() != ""))
                {
                    records_medicine_cn.Influenza = new decimal?(decimal.Parse(row["Influenza"].ToString()));
                }
                if (((row["Nasal"] != null) && (row["Nasal"] != DBNull.Value)) && (row["Nasal"].ToString() != ""))
                {
                    records_medicine_cn.Nasal = new decimal?(decimal.Parse(row["Nasal"].ToString()));
                }
                if (((row["Snore"] != null) && (row["Snore"] != DBNull.Value)) && (row["Snore"].ToString() != ""))
                {
                    records_medicine_cn.Snore = new decimal?(decimal.Parse(row["Snore"].ToString()));
                }
                if (((row["Allergy"] != null) && (row["Allergy"] != DBNull.Value)) && (row["Allergy"].ToString() != ""))
                {
                    records_medicine_cn.Allergy = new decimal?(decimal.Parse(row["Allergy"].ToString()));
                }
                if (((row["Urticaria"] != null) && (row["Urticaria"] != DBNull.Value)) && (row["Urticaria"].ToString() != ""))
                {
                    records_medicine_cn.Urticaria = new decimal?(decimal.Parse(row["Urticaria"].ToString()));
                }
                if (((row["Skin"] != null) && (row["Skin"] != DBNull.Value)) && (row["Skin"].ToString() != ""))
                {
                    records_medicine_cn.Skin = new decimal?(decimal.Parse(row["Skin"].ToString()));
                }
                if (((row["Scratch"] != null) && (row["Scratch"] != DBNull.Value)) && (row["Scratch"].ToString() != ""))
                {
                    records_medicine_cn.Scratch = new decimal?(decimal.Parse(row["Scratch"].ToString()));
                }
                if (((row["Mouth"] != null) && (row["Mouth"] != DBNull.Value)) && (row["Mouth"].ToString() != ""))
                {
                    records_medicine_cn.Mouth = new decimal?(decimal.Parse(row["Mouth"].ToString()));
                }
                if (((row["Arms"] != null) && (row["Arms"] != DBNull.Value)) && (row["Arms"].ToString() != ""))
                {
                    records_medicine_cn.Arms = new decimal?(decimal.Parse(row["Arms"].ToString()));
                }
                if (((row["Greasy"] != null) && (row["Greasy"] != DBNull.Value)) && (row["Greasy"].ToString() != ""))
                {
                    records_medicine_cn.Greasy = new decimal?(decimal.Parse(row["Greasy"].ToString()));
                }
                if (((row["Spot"] != null) && (row["Spot"] != DBNull.Value)) && (row["Spot"].ToString() != ""))
                {
                    records_medicine_cn.Spot = new decimal?(decimal.Parse(row["Spot"].ToString()));
                }
                if (((row["Eczema"] != null) && (row["Eczema"] != DBNull.Value)) && (row["Eczema"].ToString() != ""))
                {
                    records_medicine_cn.Eczema = new decimal?(decimal.Parse(row["Eczema"].ToString()));
                }
                if (((row["Thirsty"] != null) && (row["Thirsty"] != DBNull.Value)) && (row["Thirsty"].ToString() != ""))
                {
                    records_medicine_cn.Thirsty = new decimal?(decimal.Parse(row["Thirsty"].ToString()));
                }
                if (((row["Smell"] != null) && (row["Smell"] != DBNull.Value)) && (row["Smell"].ToString() != ""))
                {
                    records_medicine_cn.Smell = new decimal?(decimal.Parse(row["Smell"].ToString()));
                }
                if (((row["Abdomen"] != null) && (row["Abdomen"] != DBNull.Value)) && (row["Abdomen"].ToString() != ""))
                {
                    records_medicine_cn.Abdomen = new decimal?(decimal.Parse(row["Abdomen"].ToString()));
                }
                if (((row["Coolfood"] != null) && (row["Coolfood"] != DBNull.Value)) && (row["Coolfood"].ToString() != ""))
                {
                    records_medicine_cn.Coolfood = new decimal?(decimal.Parse(row["Coolfood"].ToString()));
                }
                if (((row["Defecate"] != null) && (row["Defecate"] != DBNull.Value)) && (row["Defecate"].ToString() != ""))
                {
                    records_medicine_cn.Defecate = new decimal?(decimal.Parse(row["Defecate"].ToString()));
                }
                if (((row["Defecatedry"] != null) && (row["Defecatedry"] != DBNull.Value)) && (row["Defecatedry"].ToString() != ""))
                {
                    records_medicine_cn.Defecatedry = new decimal?(decimal.Parse(row["Defecatedry"].ToString()));
                }
                if (((row["Tongue"] != null) && (row["Tongue"] != DBNull.Value)) && (row["Tongue"].ToString() != ""))
                {
                    records_medicine_cn.Tongue = new decimal?(decimal.Parse(row["Tongue"].ToString()));
                }
                if (((row["Vein"] != null) && (row["Vein"] != DBNull.Value)) && (row["Vein"].ToString() != ""))
                {
                    records_medicine_cn.Vein = new decimal?(decimal.Parse(row["Vein"].ToString()));
                }
                if (((row["RecordDate"] != null) && (row["RecordDate"] != DBNull.Value)) && (row["RecordDate"].ToString() != ""))
                {
                    records_medicine_cn.RecordDate = new DateTime?(DateTime.Parse(row["RecordDate"].ToString()));
                }
            }
            return(records_medicine_cn);
        }
示例#3
0
        public int Add(OlderMedicineCnModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into OLD_MEDICINE_CN(");
            builder.Append("RecordID,IDCardNo,CustomerID,PhysicalID,Energy,Tired,Breath,Voice,Emotion,Spirit,Alone,Fear,");
            builder.Append("Weight,Eye,FootHand,Stomach,Cold,Influenza,Nasal,Snore,Allergy,Urticaria,Skin,Scratch,Mouth,");
            builder.Append("Arms,Greasy,Spot,Eczema,Thirsty,Smell,Abdomen,Coolfood,Defecate,Defecatedry,Tongue,Vein,");
            builder.Append("CreatedBy,CreatedDate,LastUpdateBy,LastUpdateDate,FollowUpDoctor,RecordDate,IsDel,OUTkey)");
            builder.Append(" values (");
            builder.Append("@RecordID,@IDCardNo,@CustomerID,@PhysicalID,@Energy,@Tired,@Breath,@Voice,@Emotion,@Spirit,@Alone,@Fear,");
            builder.Append("@Weight,@Eye,@FootHand,@Stomach,@Cold,@Influenza,@Nasal,@Snore,@Allergy,@Urticaria,@Skin,@Scratch,@Mouth,");
            builder.Append("@Arms,@Greasy,@Spot,@Eczema,@Thirsty,@Smell,@Abdomen,@Coolfood,@Defecate,@Defecatedry,@Tongue,@Vein,");
            builder.Append("@CreatedBy,@CreatedDate,@LastUpdateBy,@LastUpdateDate,@FollowUpDoctor,@RecordDate,@IsDel,@OUTkey)");
            builder.Append(";select @@IDENTITY");
            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@RecordID", MySqlDbType.String, 17),
                new MySqlParameter("@IDCardNo", MySqlDbType.String, 21),
                new MySqlParameter("@CustomerID", MySqlDbType.String, 17),
                new MySqlParameter("@PhysicalID", MySqlDbType.String, 17),
                new MySqlParameter("@Energy", MySqlDbType.Decimal),
                new MySqlParameter("@Tired", MySqlDbType.Decimal),
                new MySqlParameter("@Breath", MySqlDbType.Decimal),
                new MySqlParameter("@Voice", MySqlDbType.Decimal),
                new MySqlParameter("@Emotion", MySqlDbType.Decimal),
                new MySqlParameter("@Spirit", MySqlDbType.Decimal),
                new MySqlParameter("@Alone", MySqlDbType.Decimal),
                new MySqlParameter("@Fear", MySqlDbType.Decimal),
                new MySqlParameter("@Weight", MySqlDbType.Decimal),
                new MySqlParameter("@Eye", MySqlDbType.Decimal),
                new MySqlParameter("@FootHand", MySqlDbType.Decimal),
                new MySqlParameter("@Stomach", MySqlDbType.Decimal),
                new MySqlParameter("@Cold", MySqlDbType.Decimal),
                new MySqlParameter("@Influenza", MySqlDbType.Decimal),
                new MySqlParameter("@Nasal", MySqlDbType.Decimal),
                new MySqlParameter("@Snore", MySqlDbType.Decimal),
                new MySqlParameter("@Allergy", MySqlDbType.Decimal),
                new MySqlParameter("@Urticaria", MySqlDbType.Decimal),
                new MySqlParameter("@Skin", MySqlDbType.Decimal),
                new MySqlParameter("@Scratch", MySqlDbType.Decimal),
                new MySqlParameter("@Mouth", MySqlDbType.Decimal),
                new MySqlParameter("@Arms", MySqlDbType.Decimal),
                new MySqlParameter("@Greasy", MySqlDbType.Decimal),
                new MySqlParameter("@Spot", MySqlDbType.Decimal),
                new MySqlParameter("@Eczema", MySqlDbType.Decimal),
                new MySqlParameter("@Thirsty", MySqlDbType.Decimal),
                new MySqlParameter("@Smell", MySqlDbType.Decimal),
                new MySqlParameter("@Abdomen", MySqlDbType.Decimal),
                new MySqlParameter("@Coolfood", MySqlDbType.Decimal),
                new MySqlParameter("@Defecate", MySqlDbType.Decimal),
                new MySqlParameter("@Defecatedry", MySqlDbType.Decimal),
                new MySqlParameter("@Tongue", MySqlDbType.Decimal),
                new MySqlParameter("@Vein", MySqlDbType.Decimal),
                new MySqlParameter("@CreatedBy", MySqlDbType.Decimal),
                new MySqlParameter("@CreatedDate", MySqlDbType.Date),
                new MySqlParameter("@LastUpdateBy", MySqlDbType.Decimal),
                new MySqlParameter("@LastUpdateDate", MySqlDbType.Date),
                new MySqlParameter("@FollowUpDoctor", MySqlDbType.String, 20),
                new MySqlParameter("@RecordDate", MySqlDbType.Date),
                new MySqlParameter("@IsDel", MySqlDbType.String, 1),
                new MySqlParameter("@OUTkey", MySqlDbType.Int32, 11)
            };
            cmdParms[0].Value  = model.RecordID;
            cmdParms[1].Value  = model.IDCardNo;
            cmdParms[2].Value  = model.CustomerID;
            cmdParms[3].Value  = model.PhysicalID;
            cmdParms[4].Value  = model.Energy;
            cmdParms[5].Value  = model.Tired;
            cmdParms[6].Value  = model.Breath;
            cmdParms[7].Value  = model.Voice;
            cmdParms[8].Value  = model.Emotion;
            cmdParms[9].Value  = model.Spirit;
            cmdParms[10].Value = model.Alone;
            cmdParms[11].Value = model.Fear;
            cmdParms[12].Value = model.Weight;
            cmdParms[13].Value = model.Eye;
            cmdParms[14].Value = model.FootHand;
            cmdParms[15].Value = model.Stomach;
            cmdParms[16].Value = model.Cold;
            cmdParms[17].Value = model.Influenza;
            cmdParms[18].Value = model.Nasal;
            cmdParms[19].Value = model.Snore;
            cmdParms[20].Value = model.Allergy;
            cmdParms[21].Value = model.Urticaria;
            cmdParms[22].Value = model.Skin;
            cmdParms[23].Value = model.Scratch;
            cmdParms[24].Value = model.Mouth;
            cmdParms[25].Value = model.Arms;
            cmdParms[26].Value = model.Greasy;
            cmdParms[27].Value = model.Spot;
            cmdParms[28].Value = model.Eczema;
            cmdParms[29].Value = model.Thirsty;
            cmdParms[30].Value = model.Smell;
            cmdParms[31].Value = model.Abdomen;
            cmdParms[32].Value = model.Coolfood;
            cmdParms[33].Value = model.Defecate;
            cmdParms[34].Value = model.Defecatedry;
            cmdParms[35].Value = model.Tongue;
            cmdParms[36].Value = model.Vein;
            cmdParms[37].Value = model.CreatedBy;
            cmdParms[38].Value = model.CreatedDate;
            cmdParms[39].Value = model.LastUpdateBy;
            cmdParms[40].Value = model.LastUpdateDate;
            cmdParms[41].Value = model.FollowUpDoctor;
            cmdParms[42].Value = model.RecordDate;
            cmdParms[43].Value = model.IsDel;
            cmdParms[44].Value = model.OUTkey;
            object single = MySQLHelper.GetSingle(builder.ToString(), cmdParms);

            if (single == null)
            {
                return(0);
            }
            return(Convert.ToInt32(single));
        }
示例#4
0
        public void SetCnResult(string IDCardNo)
        {
            if (string.IsNullOrEmpty(Convert.ToString(RecordsManageMentModel.BMI)) &&
                string.IsNullOrEmpty(Convert.ToString(RecordsManageMentModel.Waistline)))
            {
                return;
            }
            string strYear     = DateTime.Now.Year.ToString();
            string strOldWhere = string.Format("IDCardNo='{0}' AND  left(FollowUpDate,4) = '{1}' order by FollowUpDate Desc limit 0,1  ", IDCardNo, strYear);
            List <OlderSelfCareabilityModel> OlderList = new List <OlderSelfCareabilityModel>();

            OlderList = new OlderSelfCareabilityBLL().GetModelList(strOldWhere);
            if (OlderList.Count == 0)
            {
                return;
            }
            OlderSelfCareabilityModel olderModel = OlderList[0];

            oldMedCn     = olderMedicineCnBLL.GetModel(olderModel.IDCardNo, olderModel.ID);
            oldMedResult = olderMedicineResultBLL.GetModel(olderModel.IDCardNo, olderModel.ID);
            if (oldMedCn == null || oldMedResult == null)
            {
                return;
            }
            this.judge_qixu     = new ScoreJudge(this.oldMedResult, "FaintScore", "Faint");
            this.judge_yang     = new ScoreJudge(this.oldMedResult, "YangsCore", "Yang");
            this.judge_yin      = new ScoreJudge(this.oldMedResult, "YinScore", "Yin");
            this.judge_tanshi   = new ScoreJudge(this.oldMedResult, "PhlegmdampScore", "PhlegmDamp");
            this.judge_shire    = new ScoreJudge(this.oldMedResult, "MuggyScore", "Muggy");
            this.judge_xueyu    = new ScoreJudge(this.oldMedResult, "BloodStasisScore", "BloodStasis");
            this.judge_qiyu     = new ScoreJudge(this.oldMedResult, "QiConstraintScore", "QiConstraint");
            this.judge_tebing   = new ScoreJudge(this.oldMedResult, "CharacteristicScore", "Characteristic");
            this.judge_tizhiAll = new List <ScoreJudge>();
            this.judge_tizhiAll.AddRange((IEnumerable <ScoreJudge>) new ScoreJudge[] { this.judge_qixu, this.judge_yang, this.judge_yin, this.judge_tanshi, this.judge_shire, this.judge_xueyu, this.judge_qiyu, this.judge_tebing });
            if (!string.IsNullOrEmpty(Convert.ToString(RecordsManageMentModel.BMI)))
            {
                if (Convert.ToDouble(RecordsManageMentModel.BMI) < 24)
                {
                    oldMedCn.Weight = 1;
                }
                else if (Convert.ToDouble(RecordsManageMentModel.BMI) >= 24 && Convert.ToDouble(RecordsManageMentModel.BMI) < 25)
                {
                    oldMedCn.Weight = 2;
                }
                else if (Convert.ToDouble(RecordsManageMentModel.BMI) >= 25 && Convert.ToDouble(RecordsManageMentModel.BMI) < 26)
                {
                    oldMedCn.Weight = 3;
                }
                else if (Convert.ToDouble(RecordsManageMentModel.BMI) >= 26 && Convert.ToDouble(RecordsManageMentModel.BMI) < 28)
                {
                    oldMedCn.Weight = 4;
                }
                else if (Convert.ToDouble(RecordsManageMentModel.BMI) >= 28)
                {
                    oldMedCn.Weight = 5;
                }
            }
            if (!string.IsNullOrEmpty(Convert.ToString(RecordsManageMentModel.Waistline)))
            {
                if (Convert.ToDouble(RecordsManageMentModel.Waistline) < 80)
                {
                    oldMedCn.Abdomen = 1;
                }
                else if (Convert.ToDouble(RecordsManageMentModel.Waistline) >= 80 && Convert.ToDouble(RecordsManageMentModel.Waistline) <= 85)
                {
                    oldMedCn.Abdomen = 2;
                }
                else if (Convert.ToDouble(RecordsManageMentModel.Waistline) >= 86 && Convert.ToDouble(RecordsManageMentModel.Waistline) <= 90)
                {
                    oldMedCn.Abdomen = 3;
                }
                else if (Convert.ToDouble(RecordsManageMentModel.Waistline) >= 91 && Convert.ToDouble(RecordsManageMentModel.Waistline) <= 105)
                {
                    oldMedCn.Abdomen = 4;
                }
                else if (Convert.ToDouble(RecordsManageMentModel.Waistline) > 105)
                {
                    oldMedCn.Abdomen = 5;
                }
            }
            //this.xmlDs = new DataSet();
            //this.xmlDs.ReadXml(Application.StartupPath + @"\old_med.xml");
            //GlbTools.DatatableFillModel<OlderMedicineCnModel>(oldMedCn, this.xmlDs.Tables[0]);
            oldMedResult.FaintScore          = new decimal?(this.GetScore(oldMedCn.Tired, oldMedCn.Breath, oldMedCn.Voice, oldMedCn.Influenza));
            oldMedResult.YangsCore           = new decimal?(this.GetScore(oldMedCn.FootHand, oldMedCn.Stomach, oldMedCn.Cold, oldMedCn.Coolfood));
            oldMedResult.YinScore            = new decimal?(this.GetScore(oldMedCn.Eye, oldMedCn.Mouth, oldMedCn.Thirsty, oldMedCn.Defecatedry));
            oldMedResult.PhlegmdampScore     = new decimal?(this.GetScore(oldMedCn.Weight, oldMedCn.Snore, oldMedCn.Abdomen, oldMedCn.Tongue));
            oldMedResult.MuggyScore          = new decimal?(this.GetScore(oldMedCn.Greasy, oldMedCn.Eczema, oldMedCn.Smell, oldMedCn.Defecate));
            oldMedResult.BloodStasisScore    = new decimal?(this.GetScore(oldMedCn.Skin, oldMedCn.Arms, oldMedCn.Spot, oldMedCn.Vein));
            oldMedResult.QiConstraintScore   = new decimal?(this.GetScore(oldMedCn.Emotion, oldMedCn.Spirit, oldMedCn.Alone, oldMedCn.Fear));
            oldMedResult.CharacteristicScore = new decimal?(this.GetScore(oldMedCn.Nasal, oldMedCn.Allergy, oldMedCn.Urticaria, oldMedCn.Scratch));
            oldMedResult.MildScore           = new decimal?(this.GetPinghe(oldMedCn.Energy, oldMedCn.Tired, oldMedCn.Voice, oldMedCn.Emotion, oldMedCn.Cold));
            this.UpdateJudge();
            //修改数据
            olderMedicineCnBLL.Update(this.oldMedCn);
            olderMedicineResultBLL.Update(this.oldMedResult);
        }
 public bool Update(OlderMedicineCnModel model)
 {
     return(this.dal.Update(model));
 }
 public int Add(OlderMedicineCnModel model)
 {
     return(this.dal.Add(model));
 }
示例#7
0
        private void dgvData_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if ((this.bds.Position >= 0) && (e.RowIndex >= 0))
            {
                DataRowView view = (DataRowView)this.bds.List[this.bds.Position];

                if (((this.dgvData.Columns[e.ColumnIndex].HeaderText == "修改") && (this.bds.Position >= 0)) && (e.RowIndex >= 0))
                {
                    if (view != null)
                    {
                        DataRow row = view.Row;
                        new Controler(new MDIParentForm(view.Row["IDCardNo"].ToString()), new FocusQueryInfoFactory(Convert.ToInt32(row["ID"].ToString()), RecordsName)).IParentFrm.IShowDialog();
                        //this.GetDataView();
                    }
                }
                if (((this.dgvData.Columns[e.ColumnIndex].HeaderText == "删除") && (this.bds.Position >= 0)) && (e.RowIndex >= 0))
                {
                    if (view != null)
                    {
                        DataRow row = view.Row;
                        string  Sign = "", SignDoc = "";
                        if (MessageBox.Show("确定删除:" + row["CustomerName"].ToString() + "?删除之后的信息将无法恢复!", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                        {
                            ChronicDrugConditionBLL drugbll = new ChronicDrugConditionBLL();
                            switch (this.RecordsName)
                            {
                            case "老年人记录":
                                OlderMedicineResultBLL oldMedicineResultbll = new OlderMedicineResultBLL();
                                oldMedicineResultbll.DelOUTkey(Convert.ToInt32(row["ID"].ToString()));
                                OlderMedicineCnBLL   OlderMedicineCnbll = new OlderMedicineCnBLL();
                                OlderMedicineCnModel MedResultModel     = OlderMedicineCnbll.GetModelOUTKey(Convert.ToInt32(row["ID"].ToString()));
                                OlderMedicineCnbll.DelOUTkey(Convert.ToInt32(row["ID"].ToString()));

                                //删除签名
                                Sign = string.Format("{0}{1}_{2}_Asses.png", SignPath + "OldVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(row["CheckDate"]).ToString("yyyyMMdd"));
                                DeletSign(Sign);

                                if (MedResultModel != null)
                                {
                                    SignDoc = string.Format("{0}{1}_{2}_MeC.png", SignPath + "OldVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(MedResultModel.RecordDate).ToString("yyyyMMdd"));
                                    DeletSign(SignDoc);
                                }

                                break;

                            case "高血压记录":
                                this.drugType = "1";

                                //删除签名
                                Sign    = string.Format("{0}{1}_{2}.png", SignPath + "HypVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(row["CheckDate"]).ToString("yyyyMMdd"));
                                SignDoc = string.Format("{0}{1}_{2}_Doc.png", SignPath + "HypVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(row["CheckDate"]).ToString("yyyyMMdd"));
                                DeletSign(Sign);
                                DeletSign(SignDoc);

                                drugbll.DeleteOUTKey(Convert.ToInt32(row["ID"].ToString()), drugType);
                                break;

                            case "糖尿病记录":
                                this.drugType = "2";
                                drugbll.DeleteOUTKey(Convert.ToInt32(row["ID"].ToString()), drugType);

                                //删除签名
                                Sign    = string.Format("{0}{1}_{2}.png", SignPath + "DiaVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(row["CheckDate"]).ToString("yyyyMMdd"));
                                SignDoc = string.Format("{0}{1}_{2}_Doc.png", SignPath + "DiaVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(row["CheckDate"]).ToString("yyyyMMdd"));
                                DeletSign(Sign);
                                DeletSign(SignDoc);
                                break;

                            case "冠心病记录":
                                this.drugType = "4";
                                drugbll.DeleteOUTKey(Convert.ToInt32(row["ID"].ToString()), drugType);
                                break;

                            case "脑卒中记录":
                                this.drugType = "5";
                                drugbll.DeleteOUTKey(Convert.ToInt32(row["ID"].ToString()), drugType);
                                break;

                            case "精神病记录":
                                this.drugType = "3";
                                drugbll.DeleteOUTKey(Convert.ToInt32(row["ID"].ToString()), drugType);

                                //删除签名
                                Sign    = string.Format("{0}{1}_{2}.png", SignPath + "MentalVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(row["CheckDate"]).ToString("yyyyMMdd"));
                                SignDoc = string.Format("{0}{1}_{2}_Doc.png", SignPath + "MentalVisit//", row["IDCardNo"].ToString(), Convert.ToDateTime(row["CheckDate"]).ToString("yyyyMMdd"));
                                DeletSign(Sign);
                                DeletSign(SignDoc);
                                break;

                            case "肺结核记录":
                                ChronicLungerVisitBLL lungerVisit = new ChronicLungerVisitBLL();
                                //删除签名
                                DataSet ds = lungerVisit.GetList(" OutKey=" + Convert.ToInt32(row["ID"].ToString()));
                                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                                {
                                    string VisitCount = ds.Tables[0].Rows[i]["VisitCount"].ToString();
                                    string strDate    = Convert.ToDateTime(ds.Tables[0].Rows[i]["FollowupDate"]).ToString("yyyyMMdd");

                                    Sign    = string.Format("{0}{1}_{2}_{3}.png", SignPath + "PTBVisit//", row["IDCardNo"].ToString(), VisitCount, strDate);
                                    SignDoc = string.Format("{0}{1}_{2}_{3}_Doc.png", SignPath + "PTBVisit//", row["IDCardNo"].ToString(), VisitCount, strDate);

                                    DeletSign(Sign);
                                    DeletSign(SignDoc);
                                }

                                break;

                            case "":
                                break;

                            default: break;
                            }

                            archive_baseinfo.Delete(Convert.ToInt32(row["ID"].ToString()));
                            string where           = this.GetWhere();
                            this.totalCount        = archive_baseinfo.GetRecordCount(where);
                            this.lbTotalCount.Text = string.Format("共计{0}条", this.totalCount.ToString());

                            row.Delete();
                            row.Table.AcceptChanges();
                        }
                    }
                }
            }
        }