private PhieuChuyenKhau GetFromReader(SqlDataReader reader)
        {
            PhieuChuyenKhau phieu = new PhieuChuyenKhau();

            phieu.Ma                = int.Parse(reader["Ma"].ToString());
            phieu.MaCongDan         = int.Parse(reader["MaCongDan"].ToString());
            phieu.MaHoKhauChuyenDen = int.Parse(reader["MaHoKhauChuyenDen"].ToString());
            phieu.MaHoKhauChuyenTu  = int.Parse(reader["MaHoKhauChuyenTu"].ToString());

            string NgayChuyenKhau;

            NgayChuyenKhau = reader["NgayChuyenKhau"].ToString();

            if (!string.IsNullOrEmpty(NgayChuyenKhau.Trim()))
            {
                phieu.NgayChuyenKhau = DateTime.Parse(NgayChuyenKhau);
            }

            phieu.CongDanChuyenKhau = CongDanDAL.GetInstance().Read(phieu.MaCongDan);
            phieu.HoKhauChuyenTu    = HoKhauDAL.GetInstance().Read(phieu.MaHoKhauChuyenTu);
            phieu.HoKhauChuyenDen   = HoKhauDAL.GetInstance().Read(phieu.MaHoKhauChuyenDen);
            phieu.SelfUpdate();

            return(phieu);
        }
Example #2
0
 public static HoKhauDAL GetInstance()
 {
     if (instance == null)
     {
         instance = new HoKhauDAL();
     }
     return(instance);
 }