示例#1
0
        public List <PersonVO> SetPersonData(string firstname, string lastname, string sex,
                                             string birthdate, string voterid)
        {
            List <PersonVO> personVOList = new List <PersonVO>();
            DataTable       dataTable    = new DataTable();

            dataTable = person.GetPersonData(firstname, lastname, sex, birthdate, voterid);
            if (dataTable.Rows.Count == 0)
            {
                return(null);
            }
            foreach (DataRow dr in dataTable.Rows)
            {
                PersonVO tempPerson = new PersonVO();
                tempPerson.PersonID  = Int32.Parse(dr["PersonID"].ToString());
                tempPerson.FirstName = dr["FirstName"].ToString();
                tempPerson.LastName  = dr["LastName"].ToString();
                tempPerson.Sex       = dr["Sex"].ToString();
                tempPerson.BirthDate = dr["BirthDate"].ToString();
                tempPerson.VoterID   = dr["VoterID"].ToString();
                personVOList.Add(tempPerson);
            }
            return(personVOList);
        }