Пример #1
0
        public virtual int GetCount(int ID = 0)
        {
            var sql = "SELECT COUNT(1) AS CNT FROM COURSE AS C LEFT JOIN HISTORY AS H ON C.ID=H.COURSE_ID LEFT JOIN EMPLOYEE AS E ON H.EMP_ID=E.ID  ";

            sql += " WHERE C.ID=@ID";
            return((int)DBManager <COURSE> .ExecuteScalar(sql, new { ID = ID }));
        }
Пример #2
0
        public int CountHistorySimpleTotal(string mentor = "", string mentee = "", string dept = "", int course_id = 0)
        {
            var sql = string.Format(@"
SELECT COUNT(1) AS CNT
FROM HISTORY AS H 
INNER JOIN EMPLOYEE AS  E ON E.ID=H.EMP_ID
WHERE (@COURSE_ID='' OR H.COURSE_ID=@COURSE_ID) AND (@MENTOR='' OR H.MENTOR=@MENTOR) AND (@EMP_ID='' OR H.EMP_ID=@EMP_ID) AND (@DEPARTMENT='' OR DEPARTMENT LIKE '%'+@DEPARTMENT+'%')

");

            return((int)DBManager <HISTORY> .ExecuteScalar(sql, new
            {
                MENTOR = mentor,
                COURSE_ID = course_id,
                EMP_ID = mentee,
                DEPARTMENT = dept
            }));
        }
Пример #3
0
        public int CountHistory(string mentor = "", string mentee = "", int course_id = 0, string dept = "")
        {
            var sql = string.Format(@"
SELECT COUNT(1)
FROM HISTORY AS H
INNER JOIN HIS_DETAIL AS D ON H.ID=D.HIS_ID
INNER JOIN EMPLOYEE AS E ON E.ID=D.EMP_ID
WHERE (@MENTOR='' OR H.MENTOR=@MENTOR) AND (@EMP_ID='' OR H.EMP_ID=@EMP_ID) AND (@COURSE_ID=0 OR H.COURSE_ID=@COURSE_ID) 
AND (@DEPT='' OR DEPARTMENT LIKE '%'+DEPT+'%')
");

            return((int)DBManager <HISTORY> .ExecuteScalar(sql, new
            {
                MENTOR = mentor,
                COURSE_ID = course_id,
                EMP_ID = mentee,
                DEPT = dept
            }));
        }
Пример #4
0
        public virtual int GetCount()
        {
            var sql = "SELECT COUNT(1) AS CNT FROM ASSIGN;";

            return((int)DBManager <ASSIGN> .ExecuteScalar(sql));
        }
Пример #5
0
        public virtual int GetCount()
        {
            var sql = "SELECT COUNT(1) AS CNT FROM EMPLOYEE;";

            return((int)DBManager <EMPLOYEE> .ExecuteScalar(sql));
        }
Пример #6
0
        public int GetSearchCount(string Key)
        {
            var sql = "SELECT COUNT(1) AS CNT FROM EMPLOYEE WHERE ID LIKE @KEY +'%' OR NAME LIKE '%' +@KEY+ '%' OR DEPARTMENT LIKE '%' +@KEY+ '%';";

            return((int)DBManager <EMPLOYEE> .ExecuteScalar(sql, new { KEY = Key }));
        }
Пример #7
0
        public virtual int GetCount()
        {
            var sql = "SELECT COUNT(1) AS CNT FROM HISTORY;";

            return((int)DBManager <HISTORY> .ExecuteScalar(sql));
        }
Пример #8
0
        public virtual int GetCount()
        {
            var sql = "SELECT COUNT(1) AS CNT FROM ACTIVITY_IMG;";

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