예제 #1
0
        public virtual int GetCount(string key = "")
        {
            var sql = "SELECT COUNT(1) AS CNT FROM EMPLOYEE WHERE @key='' OR @key IS NULL OR EMP_ID LIKE @key +'%' OR EMP_NAME LIKE '%'+@key +'%';";

            return((int)DBManager <EMPLOYEE> .ExecuteScalar(sql, new { key = key }));
        }
예제 #2
0
        public List <EMPLOYEE> GetTeam()
        {
            var sql = "SELECT DISTINCT(EMP_DEPT) FROM EMPLOYEE WHERE EMP_DEPT IS NOT NULL AND EMP_DEPT <>''";

            return(DBManager <EMPLOYEE> .ExecuteReader(sql));
        }
예제 #3
0
        public virtual List <EMPLOYEE> SelectSimple()
        {
            var sql = "SELECT EMP_ID,EMP_NAME FROM EMPLOYEE ";

            return(DBManager <EMPLOYEE> .ExecuteReader(sql));
        }
예제 #4
0
        public List <CUSTOMER> GetCustomerByEmp(string EMP_ID)
        {
            var sql = "SELECT ID,NAME,CLASS FROM CUSTOMER WHERE PERSON=@ID ";

            return(DBManager <CUSTOMER> .ExecuteReader(sql, new { ID = EMP_ID }));
        }
예제 #5
0
        public int ChangePassword(string EmpId, string pass, string newpass)
        {
            var sql = "UPDATE EMPLOYEE SET PASSWORD=@NEWPASS WHERE EMP_ID=@EMP_ID AND PASSWORD=@PASS";

            return(DBManager <EMPLOYEE> .Execute(sql, new { NEWPASS = newpass, EMP_ID = EmpId, PASS = pass }));
        }
예제 #6
0
        public END_USER GetEndUserById(string ID = "")
        {
            var sql = "SELECT TOP 1 * FROM END_USER WHERE END_USER_ID=@ID";

            return(DBManager <END_USER> .ExecuteReader(sql, new { ID = ID }).FirstOrDefault());
        }
예제 #7
0
        public List <CUSTOMER> GetSimple()
        {
            var sql = "SELECT ID,NAME FROM CUSTOMER ORDER BY ID";

            return(DBManager <CUSTOMER> .ExecuteReader(sql));
        }
예제 #8
0
        public virtual int GetCount(string key = "")
        {
            var sql = "SELECT COUNT(1) AS CNT FROM CUSTOMER WHERE @key='' OR @key IS NULL OR ID LIKE @key +'%' OR NAME LIKE '%'+@key+'%' ";

            return((int)DBManager <CUSTOMER> .ExecuteScalar(sql, new { key = key }));
        }