コード例 #1
0
        public DataSet SelectByUserno(String userno)
        {
            string         cmdText = "select * from grade where userno = ?userno";
            MySqlParameter param   = new MySqlParameter("?userno", MySqlDbType.String);

            param.Value = userno;
            return(MysqlHelper.GetDataSet(cmdType, cmdText, param));
        }
コード例 #2
0
        public int Delete(int iid)
        {
            string         cmdText = "Delete FROM testpaperitem WHERE `iid`= ?iid";
            MySqlParameter param   = new MySqlParameter("?iid", MySqlDbType.Int32);

            param.Value = iid;
            return(MysqlHelper.ExecuteNonQuery(cmdType, cmdText, param));
        }
コード例 #3
0
        public DataSet SelectByPaperid(int paperid)
        {
            string         cmdText = "select * from testpaperitem where paperid = ?paperid";
            MySqlParameter param   = new MySqlParameter("?paperid", MySqlDbType.Int32);

            param.Value = paperid;
            return(MysqlHelper.GetDataSet(cmdType, cmdText, param));
        }
コード例 #4
0
        public int Insert(GradeModel item)
        {
            string cmdText = "INSERT INTO grade (`userno`, `paperid`, `grade`) VALUES (?userno, ?paperid,?grade);";

            MySqlParameter[] param = new MySqlParameter[] {
                new MySqlParameter("?userno", MySqlDbType.String),
                new MySqlParameter("?paperid", MySqlDbType.Int32),
                new MySqlParameter("?grade", MySqlDbType.Int32),
            };
            param[0].Value = item.userno;
            param[1].Value = item.paperid;
            param[2].Value = item.grade;
            return(MysqlHelper.ExecuteNonQuery(cmdType, cmdText, param));
        }
コード例 #5
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));
        }
コード例 #6
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));
        }
コード例 #7
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));
        }
コード例 #8
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));
        }
コード例 #9
0
        public DataSet SelectAll()
        {
            string cmdText = "select * from grade";

            return(MysqlHelper.GetDataSet(cmdType, cmdText, null));
        }