Ejemplo n.º 1
0
 public KhachHangInfo KhachHang_GetItem(int KhachHangID)
 {
     SQLDataHelper SQLDB = new SQLDataHelper();
     SQLDB.Addparameter("@KhachHangID", KhachHangID);
     SqlDataReader rd = SQLDB.executereader("sp_KhachHang_GetItem", CommandType.StoredProcedure);
     KhachHangInfo item = null;
     while (rd.Read())
     {
         item = new KhachHangInfo();
         item.KhachHangID = int.Parse(rd["KhachHangID"].ToString());
         item.HoTen = rd["HoTen"].ToString();
         item.DiaChi = rd["DiaChi"].ToString();
         item.DienThoai = rd["DienThoai"].ToString();
         item.CMND = rd["CMND"].ToString();
         item.NgaySinh = rd["NgaySinh"].ToString();
         item.NoiSinh = rd["NoiSinh"].ToString();
         item.SoVisa = rd["SoVisa"].ToString();
         item.ThoiHanVisa = rd["ThoiHanVisa"].ToString();
         item.NguoiTiepNhan = rd["NguoiTiepNhan"].ToString();
         item.NgayNhapCanh = rd["NgayNhapCanh"].ToString();
         item.TamTruTuNgay = rd["TamTruTuNgay"].ToString();
         item.TamTruDenNgay = rd["TamTruDenNgay"].ToString();
         item.QuocTichID = int.Parse(rd["QuocTichID"].ToString());
         item.GioiTinh = int.Parse(rd["GioiTinh"].ToString());
     }
     return item;
 }
Ejemplo n.º 2
0
        public List<KhachHangInfo> KhachHang_GetItemsInPhong([Optional, DefaultParameterValue(0)] int PhongID)
        {
            SQLDataHelper SQLDB = new SQLDataHelper();
            SQLDB.Addparameter("@PhongID", PhongID);
            SqlDataReader rd = SQLDB.executereader("sp_KhachHang_GetItemsInPhong", CommandType.StoredProcedure);
            List<KhachHangInfo> list = new List<KhachHangInfo>();
            KhachHangInfo item = null;
            while (rd.Read())
            {
                item = new KhachHangInfo();
                item.KhachHangID = int.Parse(rd["KhachHangID"].ToString());
                item.HoTen = rd["HoTen"].ToString();
                item.DiaChi = rd["DiaChi"].ToString();
                item.DienThoai = rd["DienThoai"].ToString();
                item.CMND = rd["CMND"].ToString();
                item.GioiTinh = int.Parse(rd["GioiTinh"].ToString());

                list.Add(item);
            }
            return list;
        }