public Hashtable GetIdEmployeePassword() { var reader = new EmployeesGateway().GetEmployeeIdAndPassword(); var employeesHashtable = new Hashtable(); while (reader.Read()) { employeesHashtable.Add(Convert.ToInt32(reader.GetValue(0)), Password = reader.GetValue(1).ToString()); } return(employeesHashtable); }
public IList <object> GetAllEmployees() { var reader = new EmployeesGateway().GetAllEmployees(); var employeesList = new List <object>(); while (reader.Read()) { employeesList.Add(new { Id = Convert.ToInt32(reader.GetValue(0)), Name = reader.GetValue(1).ToString(), Salary = float.Parse(reader.GetValue(2).ToString()) }); } return(employeesList); }