public IList<Core.Business.AidedEmployee> GetAllAidedEmployee() { IList<Core.Business.AidedEmployee> aidedEmployeelist = new List<Core.Business.AidedEmployee>(); SqlServerUtility sql = new SqlServerUtility(); SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllAidedEmployee); if(reader != null) { while(reader.Read()) { Core.Business.AidedEmployee aidedEmployee = new Core.Business.AidedEmployee(); if (!reader.IsDBNull(0)) aidedEmployee.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) aidedEmployee.EmployeeCode = reader.GetString(1); if (!reader.IsDBNull(2)) aidedEmployee.PoorLevel = reader.GetByte(2); if (!reader.IsDBNull(3)) aidedEmployee.Name = reader.GetString(3); if (!reader.IsDBNull(4)) aidedEmployee.People = reader.GetString(4); if (!reader.IsDBNull(5)) aidedEmployee.Sex = reader.GetByte(5); if (!reader.IsDBNull(6)) aidedEmployee.PolicticalExperience = reader.GetString(6); if (!reader.IsDBNull(7)) aidedEmployee.Birthdya = reader.GetDateTime(7); if (!reader.IsDBNull(8)) aidedEmployee.Age = reader.GetByte(8); if (!reader.IsDBNull(9)) aidedEmployee.IDCardNbr = reader.GetString(9); if (!reader.IsDBNull(10)) aidedEmployee.HealthState = reader.GetByte(10); if (!reader.IsDBNull(11)) aidedEmployee.DisabilityLevel = reader.GetByte(11); if (!reader.IsDBNull(12)) aidedEmployee.Identity = reader.GetString(12); if (!reader.IsDBNull(13)) aidedEmployee.WorkingModelType = reader.GetString(13); if (!reader.IsDBNull(14)) aidedEmployee.HouseType = reader.GetString(14); if (!reader.IsDBNull(15)) aidedEmployee.HouseArea = reader.GetDecimal(15); if (!reader.IsDBNull(16)) aidedEmployee.PostCode = reader.GetInt32(16); if (!reader.IsDBNull(17)) aidedEmployee.Phone = reader.GetString(17); if (!reader.IsDBNull(18)) aidedEmployee.YearOfWorking = reader.GetByte(18); if (!reader.IsDBNull(19)) aidedEmployee.Industry = reader.GetString(19); if (!reader.IsDBNull(20)) aidedEmployee.IsMarried = reader.GetByte(20); if (!reader.IsDBNull(21)) aidedEmployee.HUKOUtype = reader.GetString(21); if (!reader.IsDBNull(22)) aidedEmployee.Address = reader.GetString(22); if (!reader.IsDBNull(23)) aidedEmployee.Organization = reader.GetString(23); if (!reader.IsDBNull(24)) aidedEmployee.OZType = reader.GetString(24); if (!reader.IsDBNull(25)) aidedEmployee.OZState = reader.GetString(25); if (!reader.IsDBNull(26)) aidedEmployee.IsSingleParent = reader.GetByte(26); if (!reader.IsDBNull(27)) aidedEmployee.IncomingOfMonth = reader.GetDecimal(27); if (!reader.IsDBNull(28)) aidedEmployee.PersonNbrOfFamily = reader.GetByte(28); if (!reader.IsDBNull(29)) aidedEmployee.HUKOUSite = reader.GetString(29); if (!reader.IsDBNull(30)) aidedEmployee.IsMedicalInsurance = reader.GetByte(30); if (!reader.IsDBNull(31)) aidedEmployee.Resume = reader.GetString(31); if (!reader.IsDBNull(32)) aidedEmployee.Amout = reader.GetDecimal(32); if (!reader.IsDBNull(33)) aidedEmployee.ApplyingDate = reader.GetDateTime(33); aidedEmployee.MarkOld(); aidedEmployeelist.Add(aidedEmployee); } reader.Close(); } return aidedEmployeelist; }
public AidedEmployee IsExists(int id, string code) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@Id",SqlDbType.Int,id); sql.AddParameter("@EmployeeCode", SqlDbType.NVarChar, code); SqlDataReader reader = sql.ExecuteSqlReader(SqlUpdateIsExists); if (reader != null && !reader.IsClosed && reader.Read()) { Core.Business.AidedEmployee aidedEmployee = new Core.Business.AidedEmployee(); if (!reader.IsDBNull(0)) aidedEmployee.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) aidedEmployee.EmployeeCode = reader.GetString(1); if (!reader.IsDBNull(2)) aidedEmployee.PoorLevel = reader.GetByte(2); if (!reader.IsDBNull(3)) aidedEmployee.Name = reader.GetString(3); if (!reader.IsDBNull(4)) aidedEmployee.People = reader.GetString(4); if (!reader.IsDBNull(5)) aidedEmployee.Sex = reader.GetByte(5); if (!reader.IsDBNull(6)) aidedEmployee.PolicticalExperience = reader.GetString(6); if (!reader.IsDBNull(7)) aidedEmployee.Birthdya = reader.GetDateTime(7); if (!reader.IsDBNull(8)) aidedEmployee.Age = reader.GetByte(8); if (!reader.IsDBNull(9)) aidedEmployee.IDCardNbr = reader.GetString(9); if (!reader.IsDBNull(10)) aidedEmployee.HealthState = reader.GetByte(10); if (!reader.IsDBNull(11)) aidedEmployee.DisabilityLevel = reader.GetByte(11); if (!reader.IsDBNull(12)) aidedEmployee.Identity = reader.GetString(12); if (!reader.IsDBNull(13)) aidedEmployee.WorkingModelType = reader.GetString(13); if (!reader.IsDBNull(14)) aidedEmployee.HouseType = reader.GetString(14); if (!reader.IsDBNull(15)) aidedEmployee.HouseArea = reader.GetDecimal(15); if (!reader.IsDBNull(16)) aidedEmployee.PostCode = reader.GetInt32(16); if (!reader.IsDBNull(17)) aidedEmployee.Phone = reader.GetString(17); if (!reader.IsDBNull(18)) aidedEmployee.YearOfWorking = reader.GetByte(18); if (!reader.IsDBNull(19)) aidedEmployee.Industry = reader.GetString(19); if (!reader.IsDBNull(20)) aidedEmployee.IsMarried = reader.GetByte(20); if (!reader.IsDBNull(21)) aidedEmployee.HUKOUtype = reader.GetString(21); if (!reader.IsDBNull(22)) aidedEmployee.Address = reader.GetString(22); if (!reader.IsDBNull(23)) aidedEmployee.Organization = reader.GetString(23); if (!reader.IsDBNull(24)) aidedEmployee.OZType = reader.GetString(24); if (!reader.IsDBNull(25)) aidedEmployee.OZState = reader.GetString(25); if (!reader.IsDBNull(26)) aidedEmployee.IsSingleParent = reader.GetByte(26); if (!reader.IsDBNull(27)) aidedEmployee.IncomingOfMonth = reader.GetDecimal(27); if (!reader.IsDBNull(28)) aidedEmployee.PersonNbrOfFamily = reader.GetByte(28); if (!reader.IsDBNull(29)) aidedEmployee.HUKOUSite = reader.GetString(29); if (!reader.IsDBNull(30)) aidedEmployee.IsMedicalInsurance = reader.GetByte(30); if (!reader.IsDBNull(31)) aidedEmployee.Resume = reader.GetString(31); if (!reader.IsDBNull(32)) aidedEmployee.Amout = reader.GetDecimal(32); if (!reader.IsDBNull(33)) aidedEmployee.ApplyingDate = reader.GetDateTime(33); reader.Close(); aidedEmployee.MarkOld(); return aidedEmployee; } else { if (reader != null && !reader.IsClosed) reader.Close(); return null; } }