コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                maPhim = Convert.ToInt32(Request.QueryString["id"]);
                PhimBUS phimBUS = new PhimBUS();
                PhimDTO phimDTO = phimBUS.LayThongTin(maPhim);

                lbl_name.Text = phimDTO.Ten;

                SuatChieuBUS suatChieuBUS = new SuatChieuBUS();
                rdl_ngaychieu.DataSource = suatChieuBUS.LayDSNgayChieuCuaPhim(maPhim);
                rdl_ngaychieu.DataBind();
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            String        MaVe          = Request.QueryString["id"];
            VeBUS         veBUS         = new VeBUS();
            SuatChieuBUS  suatChieuBUS  = new SuatChieuBUS();
            PhimBUS       phimBUS       = new PhimBUS();
            PhongChieuBUS phongChieuBUS = new PhongChieuBUS();

            VeDTO         veDTO         = veBUS.LayThongTin(Convert.ToInt32(MaVe));
            SuatChieuDTO  suatChieuDTO  = suatChieuBUS.LayThongTin(veDTO.MaSuatChieu);
            PhimDTO       phimDTO       = phimBUS.LayThongTin(suatChieuDTO.MaPhim);
            PhongChieuDTO phongChieuDTO = phongChieuBUS.LayThongTin(suatChieuDTO.MaPhongChieu);

            VeID.Text       += veDTO.MaVe.ToString();
            Phim.Text       += phimDTO.Ten;
            PhongChieu.Text += phongChieuDTO.TenPhongChieu;
            NgayChieu.Text  += suatChieuDTO.NgayChieu;
            SuatCHieu.Text  += suatChieuDTO.GioChieu;
            SoGhe.Text      += veDTO.Ghe;
            LoaiVe.Text     += (veDTO.LoaiVe) ? "VIP" : "Thường";
            GiaVe.Text      += veDTO.GiaVe.ToString() + " VNĐ";
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PhimBUS phimBUS = new PhimBUS();

            String search = Request.QueryString["search"].ToString();

            if (search == "false")
            {
                int id = Convert.ToInt32(Request.QueryString["id"]);
                listResults.Clear();
                listResults.Add(phimBUS.LayThongTin(id));
            }
            else
            {
                String str;
                if (search == "name")
                {
                    string         name   = Request.QueryString["name"];
                    List <PhimDTO> result = phimBUS.TimKiemTheoTen(name);
                    if (result == null || result.Count == 0)
                    {
                        isError = true;
                    }
                    else
                    {
                        listResults = result;
                    }
                    lbl_error.Text = "Không tìm thấy kết quả cho : " + name;
                    byName         = true;
                }
                else
                {
                    int type = Convert.ToInt32(Request.QueryString["type"]);
                    switch (type)
                    {
                    case 0:
                        str = "Hành động";
                        break;

                    case 1:
                        str = "Viễn tưởng";
                        break;

                    case 2:
                        str = "Lãng mạn";
                        break;

                    case 3:
                        str = "Tâm lý";
                        break;

                    case 4:
                        str = "Kinh dị";
                        break;

                    default:
                        str = "Hoạt hình";
                        break;
                    }
                    List <PhimDTO> result = phimBUS.TimKiemTheoTheLoai(str);
                    if (result == null || result.Count == 0)
                    {
                        isError = true;
                    }
                    else
                    {
                        listResults = result;
                    }
                    lbl_error.Text = "Không tìm thấy phim nào thuộc thể loại " + str;
                    byName         = false;
                }
            }

            if (isError)
            {
                //Lỗi không tìm thấy phim yêu cầu
                //Session["TenPhim"] = null;
                lbl_error.Visible = true;
                img_Phim.Visible  = btn_DatVe.Visible = btn_Trailer.Visible = lbl_NoiDung.Visible = false;

                lbl_Tenphim.Visible   = lbl_Theloai.Visible = lbl_NamSX.Visible = lbl_Daodien.Visible = false;
                lbl_Dienvien.Visible  = lbl_Dotuoi.Visible = lbl_TheloaiTD.Visible = lbl_NamSXTD.Visible = false;
                lbl_DaodienTD.Visible = lbl_DienvienTD.Visible = lbl_DotuoiTD.Visible = false;

                lnk_back.Visible = lnk_forward.Visible = false;
            }
            else
            {
                lbl_error.Visible   = false;
                img_Phim.Visible    = true;
                btn_DatVe.Visible   = true;
                btn_Trailer.Visible = true;
                lbl_NoiDung.Visible = true;

                lbl_Theloai.Visible    = true;
                lbl_NamSX.Visible      = true;
                lbl_Daodien.Visible    = true;
                lbl_Dienvien.Visible   = true;
                lbl_Dotuoi.Visible     = true;
                lbl_TheloaiTD.Visible  = true;
                lbl_NamSXTD.Visible    = true;
                lbl_DaodienTD.Visible  = true;
                lbl_DienvienTD.Visible = true;
                lbl_DotuoiTD.Visible   = true;

                countResults = listResults.Count;
                if (curResult == countResults - 1 || countResults == 1)
                {
                    lnk_back.Visible    = true;
                    lnk_forward.Visible = false;
                }
                else
                {
                    lnk_back.Visible    = true;
                    lnk_forward.Visible = true;
                }
                img_Phim.ImageUrl = listResults[curResult].Poster;
                img_Phim.DataBind();
                lbl_NoiDung.Text  = listResults[curResult].NoiDung;
                lbl_Tenphim.Text  = listResults[curResult].Ten;
                lbl_Theloai.Text  = listResults[curResult].TheLoai;
                lbl_NamSX.Text    = listResults[curResult].NamSanXuat.ToString();
                lbl_Daodien.Text  = listResults[curResult].DaoDien;
                lbl_Dienvien.Text = listResults[curResult].DienVien;
                lbl_Dotuoi.Text   = listResults[curResult].GioiHanDoTuoi.ToString();
            }
        }