示例#1
0
 public bool InsertQuestionnaire(Model.QuestionnaireModel model)
 {
     return(questionnaireDAL.InsertQuestionnaire(model));
 }
示例#2
0
        public bool InsertQuestionnaire(Model.QuestionnaireModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into GP_Questionnaire(");
            strSql.Append("id,training_base_name,training_base_code,professional_base_name,professional_base_code,rotary_dept_name,rotary_dept_code,instructor,one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,advice,register_date,writor)");
            strSql.Append(" values (");
            strSql.Append("@id,@training_base_name,@training_base_code,@professional_base_name,@professional_base_code,@rotary_dept_name,@rotary_dept_code,@instructor,@one,@two,@three,@four,@five,@six,@seven,@eight,@nine,@ten,@eleven,@twelve,@thirteen,@advice,@register_date,@writor)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id",                     SqlDbType.NVarChar,  50),
                new SqlParameter("@training_base_name",     SqlDbType.NVarChar,  50),
                new SqlParameter("@training_base_code",     SqlDbType.NVarChar,  50),
                new SqlParameter("@professional_base_name", SqlDbType.NVarChar,  50),
                new SqlParameter("@professional_base_code", SqlDbType.NVarChar,  50),
                new SqlParameter("@rotary_dept_name",       SqlDbType.NVarChar, 100),
                new SqlParameter("@rotary_dept_code",       SqlDbType.NVarChar,  50),
                new SqlParameter("@instructor",             SqlDbType.NVarChar,  50),
                new SqlParameter("@one",                    SqlDbType.NVarChar,  10),
                new SqlParameter("@two",                    SqlDbType.NVarChar,  10),
                new SqlParameter("@three",                  SqlDbType.NVarChar,  10),
                new SqlParameter("@four",                   SqlDbType.NVarChar,  10),
                new SqlParameter("@five",                   SqlDbType.NVarChar,  10),
                new SqlParameter("@six",                    SqlDbType.NVarChar,  10),
                new SqlParameter("@seven",                  SqlDbType.NVarChar,  10),
                new SqlParameter("@eight",                  SqlDbType.NVarChar,  10),
                new SqlParameter("@nine",                   SqlDbType.NVarChar,  10),
                new SqlParameter("@ten",                    SqlDbType.NVarChar,  10),
                new SqlParameter("@eleven",                 SqlDbType.NVarChar,  10),
                new SqlParameter("@twelve",                 SqlDbType.NVarChar,  10),
                new SqlParameter("@thirteen",               SqlDbType.NVarChar,  10),
                new SqlParameter("@advice",                 SqlDbType.NVarChar, 500),
                new SqlParameter("@register_date",          SqlDbType.NVarChar,  50),
                new SqlParameter("@writor",                 SqlDbType.NVarChar, 50)
            };
            parameters[0].Value  = model.id;
            parameters[1].Value  = model.training_base_name;
            parameters[2].Value  = model.training_base_code;
            parameters[3].Value  = model.professional_base_name;
            parameters[4].Value  = model.professional_base_code;
            parameters[5].Value  = model.rotary_dept_name;
            parameters[6].Value  = model.rotary_dept_code;
            parameters[7].Value  = model.instructor;
            parameters[8].Value  = model.one;
            parameters[9].Value  = model.two;
            parameters[10].Value = model.three;
            parameters[11].Value = model.four;
            parameters[12].Value = model.five;
            parameters[13].Value = model.six;
            parameters[14].Value = model.seven;
            parameters[15].Value = model.eight;
            parameters[16].Value = model.nine;
            parameters[17].Value = model.ten;
            parameters[18].Value = model.eleven;
            parameters[19].Value = model.twelve;
            parameters[20].Value = model.thirteen;
            parameters[21].Value = model.advice;
            parameters[22].Value = model.register_date;
            parameters[23].Value = model.writor;

            int rows = db.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }