示例#1
0
        public int Insert(UserModel item)
        {
            string cmdText = "INSERT INTO `user` (`userno`, `password`, `type`) VALUES (?userno, ?password, ?type);";

            MySqlParameter[] param = new MySqlParameter[] {
                new MySqlParameter("?userno", MySqlDbType.String),
                new MySqlParameter("?password", MySqlDbType.String),
                new MySqlParameter("?type", MySqlDbType.Int32),
            };
            param[0].Value = item.userno;
            param[1].Value = item.password;
            param[2].Value = item.type;

            return(MysqlHelper.ExecuteNonQuery(cmdType, cmdText, param));
        }
示例#2
0
        public int Update(TestpaperitemModel item)
        {
            string cmdText = "UPDATE `testpaperitem` SET `question` = ?question, `paperid`= ?paperid, `select1_score`= ?select1_score, `select2_score`= ?select2_score, `select3_score`= ?select3_score, `select4_score`= ?select4_score WHERE (`iid`=?iid);";

            MySqlParameter[] param = new MySqlParameter[] {
                new MySqlParameter("?question", MySqlDbType.String),
                new MySqlParameter("?paperid", MySqlDbType.Int32),
                new MySqlParameter("?select1_score", MySqlDbType.Float),
                new MySqlParameter("?select2_score", MySqlDbType.Float),
                new MySqlParameter("?select3_score", MySqlDbType.Float),
                new MySqlParameter("?select4_score", MySqlDbType.Float),
            };
            param[0].Value = item.question;
            param[1].Value = item.paperid;
            param[2].Value = item.select1_score;
            param[3].Value = item.select2_score;
            param[4].Value = item.select3_score;
            param[5].Value = item.select4_score;

            return(MysqlHelper.ExecuteNonQuery(cmdType, cmdText, param));
        }
示例#3
0
        public int Insert(TestpaperitemModel item)
        {
            string cmdText = "INSERT INTO testpaperitem (`question`, `paperid`, `select1_score`, `select2_score`, `select3_score`, `select4_score`) VALUES (?question, ?paperid,?select1_score,?select2_score,?select3_score,?select4_score);";

            MySqlParameter[] param = new MySqlParameter[] {
                new MySqlParameter("?question", MySqlDbType.String),
                new MySqlParameter("?paperid", MySqlDbType.Int32),
                new MySqlParameter("?select1_score", MySqlDbType.Float),
                new MySqlParameter("?select2_score", MySqlDbType.Float),
                new MySqlParameter("?select3_score", MySqlDbType.Float),
                new MySqlParameter("?select4_score", MySqlDbType.Float),
            };
            param[0].Value = item.question;
            param[1].Value = item.paperid;
            param[2].Value = item.select1_score;
            param[3].Value = item.select2_score;
            param[4].Value = item.select3_score;
            param[5].Value = item.select4_score;

            return(MysqlHelper.ExecuteNonQuery(cmdType, cmdText, param));
        }
示例#4
0
        public int Insert(TestpapersModel item)
        {
            string cmdText = "INSERT INTO testpapers (`papername`, `introduce`, `gradeproduct`, `select1_name`, `select2_name`, `select3_name`, `select4_name`) VALUES (?papername, ?introduce, ?gradeproduct, ?select1_name,?select2_name,?select3_name,?select4_name);";

            MySqlParameter[] param = new MySqlParameter[] {
                new MySqlParameter("?papername", MySqlDbType.String),
                new MySqlParameter("?introduce", MySqlDbType.String),
                new MySqlParameter("?gradeproduct", MySqlDbType.Float),
                new MySqlParameter("?select1_name", MySqlDbType.String),
                new MySqlParameter("?select2_name", MySqlDbType.String),
                new MySqlParameter("?select3_name", MySqlDbType.String),
                new MySqlParameter("?select4_name", MySqlDbType.String),
            };
            param[0].Value = item.papername;
            param[1].Value = item.introduce;
            param[2].Value = item.gradeproduct;
            param[3].Value = item.select1_name;
            param[4].Value = item.select2_name;
            param[5].Value = item.select3_name;
            param[6].Value = item.select4_name;
            return(MysqlHelper.ExecuteNonQuery(cmdType, cmdText, param));
        }