コード例 #1
0
ファイル: COURSE.cs プロジェクト: nhonduyen/OJT
        public virtual int GetCount()
        {
            var sql = "SELECT COUNT(1) AS CNT FROM COURSE ";

            return((int)DBManager <COURSE> .ExecuteScalar(sql));
        }
コード例 #2
0
ファイル: COURSE.cs プロジェクト: nhonduyen/OJT
        public virtual List <COURSE> SelectPaging(int start = 0, int end = 10)
        {
            var sql = "SELECT * FROM(SELECT ROW_NUMBER() OVER (order by id) AS ROWNUM, * FROM COURSE) as u  WHERE   RowNum >= @start   AND RowNum < @end ORDER BY RowNum;";

            return(DBManager <COURSE> .ExecuteReader(sql, new { start = start, end = end }));
        }
コード例 #3
0
        public virtual int Insert(int DETAIL_ID, string IMG_URL)
        {
            var sql = "INSERT INTO ACTIVITY_IMG(DETAIL_ID,IMG_URL) VALUES(@DETAIL_ID,@IMG_URL)";

            return(DBManager <ACTIVITY_IMG> .Execute(sql, new { DETAIL_ID = DETAIL_ID, IMG_URL = IMG_URL }));
        }
コード例 #4
0
        public virtual int Update(int DETAIL_ID, string IMG_URL)
        {
            var sql = "UPDATE ACTIVITY_IMG SET DETAIL_ID=@DETAIL_ID,IMG_URL=@IMG_URL WHERE ID=@ID";

            return(DBManager <ACTIVITY_IMG> .Execute(sql, new { DETAIL_ID = DETAIL_ID, IMG_URL = IMG_URL }));
        }
コード例 #5
0
        public virtual int GetCount()
        {
            var sql = "SELECT COUNT(1) AS CNT FROM ACTIVITY_IMG;";

            return((int)DBManager <ACTIVITY_IMG> .ExecuteScalar(sql));
        }