Exemplo n.º 1
0
 /// <summary>
 /// 抑郁评估的新增
 /// </summary>
 /// <param name="model"></param>
 /// <param name="OutKey"></param>
 /// <returns></returns>
 public int Add(OldGloomyModel model, string OutKey)
 {
     return(this.dal.Add(model, OutKey));
 }
Exemplo n.º 2
0
        /// <summary>
        /// 抑郁评估的新增
        /// </summary>
        /// <param name="model"></param>
        /// <param name="OutKey"></param>
        /// <returns></returns>
        public int Add(OldGloomyModel model, string OutKey)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(@"INSERT INTO tbl_OldGloomy
                                    (
                                        IDCardNo
                                        ,Satisfied
                                        ,Hobby
                                        ,Emptiness
                                        ,Boring
                                        ,Hope
                                        ,Annoyance
                                        ,Spirit
                                        ,Fair
                                        ,Happy
                                        ,Helpless
                                        ,Calm
                                        ,Lazy
                                        ,Future
                                        ,Memory
                                        ,Life
                                        ,Mood
                                        ,Useless
                                        ,Worry
                                        ,Excitement
                                        ,Study
                                        ,Energy
                                        ,Present
                                        ,Feel
                                        ,Doing
                                        ,Cry
                                        ,Focus
                                        ,Morning
                                        ,Activity
                                        ,Decision
                                        ,Brain
                                        ,TotalScore
                                        ,OldHealthStaus
                                        ,VisitDate
                                        ,VisitDoctor
                                        ,NextVisitDate
                                        ,CreatedBy
                                        ,CreatedDate
                                        ,LastUpDateBy
                                        ,LastUpDateDate
                                        ,OutKey
                                    )
                                    VALUES
                                    (
                                        @IDCardNo
                                        ,@Satisfied
                                        ,@Hobby
                                        ,@Emptiness
                                        ,@Boring
                                        ,@Hope
                                        ,@Annoyance
                                        ,@Spirit
                                        ,@Fair
                                        ,@Happy
                                        ,@Helpless
                                        ,@Calm
                                        ,@Lazy
                                        ,@Future
                                        ,@Memory
                                        ,@Life
                                        ,@Mood
                                        ,@Useless
                                        ,@Worry
                                        ,@Excitement
                                        ,@Study
                                        ,@Energy
                                        ,@Present
                                        ,@Feel
                                        ,@Doing
                                        ,@Cry
                                        ,@Focus
                                        ,@Morning
                                        ,@Activity
                                        ,@Decision
                                        ,@Brain
                                        ,@TotalScore
                                        ,@OldHealthStaus
                                        ,@VisitDate
                                        ,@VisitDoctor
                                        ,@NextVisitDate
                                        ,@CreatedBy
                                        ,@CreatedDate
                                        ,@LastUpDateBy
                                        ,@LastUpDateDate
                                        ,@OutKey
                                    ) ");

            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@IDCardNo", MySqlDbType.String, 18),
                new MySqlParameter("@Satisfied", MySqlDbType.Int32),
                new MySqlParameter("@Hobby", MySqlDbType.Int32),
                new MySqlParameter("@Emptiness", MySqlDbType.Int32),
                new MySqlParameter("@Boring", MySqlDbType.Int32),
                new MySqlParameter("@Hope", MySqlDbType.Int32),
                new MySqlParameter("@Annoyance", MySqlDbType.Int32),
                new MySqlParameter("@Spirit", MySqlDbType.Int32),
                new MySqlParameter("@Fair", MySqlDbType.Int32),
                new MySqlParameter("@Happy", MySqlDbType.Int32),
                new MySqlParameter("@Helpless", MySqlDbType.Int32),
                new MySqlParameter("@Calm", MySqlDbType.Int32),
                new MySqlParameter("@Lazy", MySqlDbType.Int32),
                new MySqlParameter("@Future", MySqlDbType.Int32),
                new MySqlParameter("@Memory", MySqlDbType.Int32),
                new MySqlParameter("@Life", MySqlDbType.Int32),
                new MySqlParameter("@Mood", MySqlDbType.Int32),
                new MySqlParameter("@Useless", MySqlDbType.Int32),
                new MySqlParameter("@Worry", MySqlDbType.Int32),
                new MySqlParameter("@Excitement", MySqlDbType.Int32),
                new MySqlParameter("@Study", MySqlDbType.Int32),
                new MySqlParameter("@Energy", MySqlDbType.Int32),
                new MySqlParameter("@Present", MySqlDbType.Int32),
                new MySqlParameter("@Feel", MySqlDbType.Int32),
                new MySqlParameter("@Doing", MySqlDbType.Int32),
                new MySqlParameter("@Cry", MySqlDbType.Int32),
                new MySqlParameter("@Focus", MySqlDbType.Int32),
                new MySqlParameter("@Morning", MySqlDbType.Int32),
                new MySqlParameter("@Activity", MySqlDbType.Int32),
                new MySqlParameter("@Decision", MySqlDbType.Int32),
                new MySqlParameter("@Brain", MySqlDbType.Int32),
                new MySqlParameter("@TotalScore", MySqlDbType.Int32),
                new MySqlParameter("@OldHealthStaus", MySqlDbType.String, 1),
                new MySqlParameter("@VisitDate", MySqlDbType.Date),
                new MySqlParameter("@VisitDoctor", MySqlDbType.String, 50),
                new MySqlParameter("@NextVisitDate", MySqlDbType.Date),
                new MySqlParameter("@CreatedBy", MySqlDbType.String, 100),
                new MySqlParameter("@CreatedDate", MySqlDbType.Date),
                new MySqlParameter("@LastUpDateBy", MySqlDbType.String, 100),
                new MySqlParameter("@LastUpDateDate", MySqlDbType.Date),
                new MySqlParameter("@OutKey", MySqlDbType.Int32)
            };

            cmdParms[0].Value  = model.IDCardNo;
            cmdParms[1].Value  = model.Satisfied == "" ? null : model.Satisfied;
            cmdParms[2].Value  = model.Hobby == "" ? null : model.Hobby;
            cmdParms[3].Value  = model.Emptiness == "" ? null : model.Emptiness;
            cmdParms[4].Value  = model.Boring == "" ? null : model.Boring;
            cmdParms[5].Value  = model.Hope == "" ? null : model.Hope;
            cmdParms[6].Value  = model.Annoyance == "" ? null : model.Annoyance;
            cmdParms[7].Value  = model.Spirit == "" ? null : model.Spirit;
            cmdParms[8].Value  = model.Fair == "" ? null : model.Fair;
            cmdParms[9].Value  = model.Happy == "" ? null : model.Happy;
            cmdParms[10].Value = model.Helpless == "" ? null : model.Helpless;
            cmdParms[11].Value = model.Calm == "" ? null : model.Calm;
            cmdParms[12].Value = model.Lazy == "" ? null : model.Lazy;
            cmdParms[13].Value = model.Future == "" ? null : model.Future;
            cmdParms[14].Value = model.Memory == "" ? null : model.Memory;
            cmdParms[15].Value = model.Life == "" ? null : model.Life;
            cmdParms[16].Value = model.Mood == "" ? null : model.Mood;
            cmdParms[17].Value = model.Useless == "" ? null : model.Useless;
            cmdParms[18].Value = model.Worry == "" ? null : model.Worry;
            cmdParms[19].Value = model.Excitement == "" ? null : model.Excitement;
            cmdParms[20].Value = model.Study == "" ? null : model.Study;
            cmdParms[21].Value = model.Energy == "" ? null : model.Energy;
            cmdParms[22].Value = model.Present == "" ? null : model.Present;
            cmdParms[23].Value = model.Feel == "" ? null : model.Feel;
            cmdParms[24].Value = model.Doing == "" ? null : model.Doing;
            cmdParms[25].Value = model.Cry == "" ? null : model.Cry;
            cmdParms[26].Value = model.Focus == "" ? null : model.Focus;
            cmdParms[27].Value = model.Morning == "" ? null : model.Morning;
            cmdParms[28].Value = model.Activity == "" ? null : model.Activity;
            cmdParms[29].Value = model.Decision == "" ? null : model.Decision;
            cmdParms[30].Value = model.Brain == "" ? null : model.Brain;
            cmdParms[31].Value = model.TotalScore == "" ? null : model.TotalScore;
            cmdParms[32].Value = model.OldHealthStaus;
            cmdParms[33].Value = model.VisitDate;
            cmdParms[34].Value = model.VisitDoctor;
            cmdParms[35].Value = model.NextVisitDate;
            cmdParms[36].Value = model.CreatedBy;
            cmdParms[37].Value = model.CreatedDate;
            cmdParms[38].Value = model.LastUpDateBy;
            cmdParms[39].Value = model.LastUpDateDate;
            cmdParms[40].Value = OutKey;

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

            if (single == null)
            {
                return(0);
            }

            return(Convert.ToInt32(single));
        }