コード例 #1
0
 public QuanLyPhim()
 {
     InitializeComponent();
     lbHi.Text = $"Hi {Login.UserName}!";
     phimBLL   = new PhimBLL();
     dgvPhim.Columns[3].DefaultCellStyle.Format = "dd/MM/yyyy";
     pbPoster.SizeMode       = PictureBoxSizeMode.StretchImage;
     cbOptions.SelectedIndex = 0;
 }
コード例 #2
0
        protected void btnXoaPhim_Click(object sender, EventArgs e)
        {
            PhimBLL phimBLL = new PhimBLL();
            bool    kq      = phimBLL.XoaPhim(Int32.Parse(txtMaPhim.Text), txtTenPhimGoc.Text);

            if (kq)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Thành Công", "alert('" + "Delete Successed!" + "');", true);
                XoaThongTin();
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "alert('" + "Delete Failed!" + "');", true);
                XoaThongTin();
            }
        }
コード例 #3
0
        protected void btnInsert_Update_Phim_Click(object sender, EventArgs e)
        {
            PhimBLL phimbll = new PhimBLL();
            Phim    phim    = new Phim();
            bool    kq      = phimbll.KT_MaPhim(Int32.Parse(txtMaPhim.Text));

            phim.MaPhim      = Int32.Parse(txtMaPhim.Text);
            phim.TenPhimGoc  = txtTenPhimGoc.Text;
            phim.TenPhim     = txtTenPhimTV.Text;
            phim.QuocGia     = txtQuocGia.Text;
            phim.NoiDung     = txtNoiDung.Text;
            phim.TheLoai     = txtTheLoai.Text;
            phim.TrangThai   = txtTrangThai.Text;
            phim.NamPhatSong = txtNamPhatSong.Text;
            phim.HinhAnh     = LocDuLieuFileUpload(Fupload_HinhAnh, true);
            phim.DuongDan    = LocDuLieuFileUpload(Fupload_DuongDanPhim, false);
            phim.ThoiLuong   = Int32.Parse(txtThoiLuong.Text);
            if (kq)
            {
                kq = phimbll.CapNhapPhim(phim);
                if (kq)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Thành Công", "alert('" + "Update Successed!" + "');", true);
                    XoaThongTin();
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "alert('" + "Update Failed!" + "');", true);
                    XoaThongTin();
                }
            }
            else
            {
                kq = phimbll.ThemPhimMoi(phim);
                if (kq)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Thành Công", "alert('" + "Insert Successed!" + "');", true);
                    XoaThongTin();
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "alert('" + "Insert Failed!" + "');", true);
                    XoaThongTin();
                }
            }
        }