public static List <EmployeeRole> GetAccountRoleListLimited() { List <EmployeeRole> list = new List <EmployeeRole>(); Database db = DatabaseFactory.CreateDatabase("Spar-StoreRep"); string sqlCommand = "GetAccountRoleListLimited"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { EmployeeRole employeeRole = new EmployeeRole(); employeeRole.Description = dataReader["Description"].ToString(); list.Add(employeeRole); } } return(list); }
public static List <EmployeeRole> GetRoleListByFilter(string searchValue) { List <EmployeeRole> list = new List <EmployeeRole>(); Database db = DatabaseFactory.CreateDatabase("Spar-StoreRep"); string sqlCommand = "GetRoleListByFilter"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "@SearchValue", DbType.String, searchValue); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { EmployeeRole employeeRole = new EmployeeRole(); employeeRole.Description = dataReader["Description"].ToString(); list.Add(employeeRole); } } return(list); }
public static List <EmployeeRole> GetEmployeeRoleListByEmployeeId(int employeeId) { List <EmployeeRole> list = new List <EmployeeRole>(); Database db = DatabaseFactory.CreateDatabase("Spar-StoreRep"); string sqlCommand = "GetEmployeeRoleListByEmployeeId"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "@EmployeeId", DbType.Int32, employeeId); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { EmployeeRole employeeRole = new EmployeeRole(); employeeRole.EmployeeRoleId = Convert.ToInt32(dataReader["EmployeeRoleId"]); employeeRole.EmployeeId = Convert.ToInt32(dataReader["EmployeeId"]); employeeRole.Description = dataReader["RoleName"].ToString(); list.Add(employeeRole); } } return(list); }