public static Users GetDefaultApplicationByUserCode(string userCode) { ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan); IDataReader reader = null; conManager.OpenDataReader(out reader, "spWebGetDefaultApplicationByUserCode", userCode); try { Users user = new Users(); while (reader.Read()) { user.SetData(reader); break; } return(user); } catch (Exception ex) { throw (ex); } finally { if (conManager != null) { conManager.CloseConnection(); conManager.Dispose(); } if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static Users GetUserInfoByEmployeeCode(String employeeCode) { ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan); IDataReader reader = null; String sql = String.Format("Select * From [User] Where EmployeeCode = '{0}'", employeeCode); try { conManager.OpenDataReader(sql, out reader); Users user = new Users(); while (reader.Read()) { user.SetData(reader); break; } return(user); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <Users> doSearch(string whereClause) { ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan); CustomList <Users> UsersCollection = new CustomList <Users>(); IDataReader reader = null; String sql = string.Format("Select * From [User] Where 1=1 {0}", whereClause); try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Users newUsers = new Users(); newUsers.SetData(reader); UsersCollection.Add(newUsers); } return(UsersCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static Users GetUserInfoByEmployeeCode(String employeeCode) { ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan); IDataReader reader = null; String sql = String.Format("Select * From [User] Where EmployeeCode = '{0}'", employeeCode); try { conManager.OpenDataReader(sql, out reader); Users user = new Users(); while (reader.Read()) { user.SetData(reader); break; } return user; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }
public static Users GetDefaultApplicationByUserCode(string userCode) { ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan); IDataReader reader = null; conManager.OpenDataReader(out reader, "spWebGetDefaultApplicationByUserCode", userCode); try { Users user = new Users(); while (reader.Read()) { user.SetData(reader); break; } return user; } catch (Exception ex) { throw (ex); } finally { if (conManager != null) { conManager.CloseConnection(); conManager.Dispose(); } if (reader != null && !reader.IsClosed) reader.Close(); } }
public static CustomList<Users> doSearch(string whereClause) { ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan); CustomList<Users> UsersCollection = new CustomList<Users>(); IDataReader reader = null; String sql = string.Format("Select * From [User] Where 1=1 {0}", whereClause); try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Users newUsers = new Users(); newUsers.SetData(reader); UsersCollection.Add(newUsers); } return UsersCollection; } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) reader.Close(); } }