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 })); }
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)); }
public virtual List <EMPLOYEE> SelectSimple() { var sql = "SELECT EMP_ID,EMP_NAME FROM EMPLOYEE "; return(DBManager <EMPLOYEE> .ExecuteReader(sql)); }
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 })); }
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 })); }
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()); }
public List <CUSTOMER> GetSimple() { var sql = "SELECT ID,NAME FROM CUSTOMER ORDER BY ID"; return(DBManager <CUSTOMER> .ExecuteReader(sql)); }
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 })); }