public static List <DTO.Staff> Staff_Search_SelectList(Staff.BLDAL.DTO.Staff _StaffLine) { List <Staff.BLDAL.DTO.Staff> StaffList = new List <Staff.BLDAL.DTO.Staff>(); try { StaffDAL IO = new StaffDAL(); SqlDataReader myReader = IO.Staff_Search_SelectList(_StaffLine); while (myReader.Read()) { Staff.BLDAL.DTO.Staff StaffLine = new Staff.BLDAL.DTO.Staff(); if (myReader["StaffID"] != DBNull.Value) { StaffLine.StaffID = (int)myReader["StaffID"]; } if (myReader["LastName"] != DBNull.Value) { StaffLine.LastName = (string)myReader["CompanyName"]; } if (myReader["MiddleName"] != DBNull.Value) { StaffLine.MiddleName = (string)myReader["Address"]; } if (myReader["FirstName"] != DBNull.Value) { StaffLine.FirstName = (string)myReader["FirstName"]; } if (myReader["Gender"] != DBNull.Value) { StaffLine.Gender = (string)myReader["Gender"]; } if (myReader["Position"] != DBNull.Value) { StaffLine.Position = (string)myReader["Position"]; } if (myReader["HiredDate"] != DBNull.Value) { StaffLine.HiredDate = (string)myReader["HiredDate"]; } if (myReader["Salary"] != DBNull.Value) { StaffLine.Salary = (string)myReader["Salary"]; } StaffList.Add(StaffLine); } myReader.Close(); } catch (Exception ex) { if (ConfigurationManager.AppSettings["RethrowErrors"] == "true") { throw ex; } return(new List <Staff.BLDAL.DTO.Staff>()); } return(StaffList); }