Exemplo n.º 1
0
        private DuLieuDTO createDuLieuFromReader(IDataReader reader)
        {
            DuLieuDTO dl = new DuLieuDTO();

            try
            {
                dl.MaDuLieu   = Convert.ToInt32(reader[_fileds[0]]);
                dl.DichVu     = _dvDAO.getDichVuInDulieu(Convert.ToInt32(reader[_fileds[1]]));
                dl.TenDiaDiem = _tddDAO.getTenDiaDiemInDulieu(Convert.ToInt32(reader[_fileds[2]]));
                dl.SoNha      = reader[_fileds[3]] == null ? "" : reader[_fileds[3]].ToString();
                dl.Duong      = _dDAO.getDuongInDulieu(Convert.ToInt32(reader[_fileds[4]]));
                dl.Phuong     = _pDAO.getPhuongInDulieu(Convert.ToInt32(reader[_fileds[5]]));
                dl.QuanHuyen  = _qhDAO.getQuanHuyenInDulieu(Convert.ToInt32(reader[_fileds[6]]));
                dl.TinhThanh  = _ttDAO.getTinhThanhInDulieu(Convert.ToInt32(reader[_fileds[7]]));
                dl.KinhDo     = Convert.ToDouble(reader[_fileds[8]]);
                dl.ViDo       = Convert.ToDouble(reader[_fileds[9]]);
                dl.ChuThich   = reader[_fileds[10]] == null ? "" : reader[_fileds[10]].ToString();
            }
            catch (Exception)
            {
            }
            return(dl);
        }