protected void btnThem_Click(object sender, EventArgs e) { messenger.Text = ""; try { string path = Server.MapPath(srcImage); fileAnh.PostedFile.SaveAs(path + fileAnh.FileName); taiLieuBLL = new TaiLieuBLL(); TaiLieu taiLieu = new TaiLieu(); taiLieu.MaTLieu = txtMaTLieu.Text; taiLieu.MaTLoai = dropTheLoai.SelectedValue; taiLieu.TenTLieu = txtTenTLieu.Text; taiLieu.SLuong = Int32.Parse(txtSoLuong.Text); taiLieu.NXB = txtNXB.Text; taiLieu.NamXB = Int32.Parse(txtNamXB.Text); taiLieu.MaTG = drTacGia.SelectedValue; if (fileAnh.HasFile) { taiLieu.Anh = fileAnh.FileName; } taiLieuBLL.addDocument(taiLieu); LoadData(); messenger.Text = "Thêm thành công tài liệu."; } catch (Exception e1) { messenger.Text = "Thêm tài liệu thất bại" + e1.Message; } }
public ucManagerDocuments(Home home) { InitializeComponent(); this.home = home; tlBll = new TaiLieuBLL(); //Khoi tao truoc khi su dung LoadGridView(); }
public ucDialogAddBookForBorrow(ucDialogBill ucBillDialog) { InitializeComponent(); this.tlBll = new TaiLieuBLL(); this.ucBillDialog = ucBillDialog; setDataForGridView(ucBillDialog.getDtCreateBorrows()); }
private void loadDropTaiLieu() { List <TaiLieu> dsTL = new TaiLieuBLL().getListDocument(); drSach.DataSource = dsTL; drSach.DataValueField = "MaTLieu"; drSach.DataTextField = "TenTLieu"; DataBind(); }
public ucDialogReNewBooks(ucDialogBill ucBooksDialog) { InitializeComponent(); this.pmBLL = new PhieuMuonBLL(); this.tlBll = new TaiLieuBLL(); this.ucBooksDialog = ucBooksDialog; this.selectBookHistoryId = ucBooksDialog.SelectBookHistoryId; setInfoDialog(selectBookHistoryId); }
protected void quanLySua(object o, CommandEventArgs e) { if (e.CommandName == "suaTaiLieu") { string ma = e.CommandArgument.ToString(); TaiLieu taiLieu = new TaiLieuBLL().GetTaiLieuTheoMa(ma); Session["tailieu"] = taiLieu; Response.Redirect("/Admin/Edit/SuaTaiLieu.aspx"); } }
protected void quanLyXoa(object o, CommandEventArgs e) { if (e.CommandName == "xoaTaiLieu") { string ma = e.CommandArgument.ToString(); taiLieuBLL = new TaiLieuBLL(); messenger.Text = taiLieuBLL.deleteDoc(ma); LoadData(); } }
protected void LoadData() { List <TaiLieu> dsTl = new TaiLieuBLL().getListDocument(); foreach (TaiLieu tl in dsTl) { tl.Anh = ResolveUrl(srcImage + tl.Anh); } grTaiLieu.DataSource = dsTl; DataBind(); }
public ucDialogDocument(ucManagerDocuments ucManagerDocuments) { InitializeComponent(); tlBll = new TaiLieuBLL(); this.ucManagerDocuments = ucManagerDocuments; idDocumentSelect = ucManagerDocuments.IdDocumentSelect; if (idDocumentSelect > 0) // Id ban ghi cap nhat > 0 ==> Cap nhat { setInfoDialog(idDocumentSelect); } else { setResetData(); } }
protected void btnTimKiem_Click(object sender, EventArgs e) { lblTK.Text = ""; string ten = txtTimKiem.Text; if (ten.Length > 0) { List <TaiLieu> dsTl = new TaiLieuBLL().getListDocument("%" + ten + "%"); lblTK.Text = "Kết quả tìm kiếm: " + dsTl.Count; foreach (TaiLieu tl in dsTl) { tl.Anh = ResolveUrl(srcImage + tl.Anh); } grTaiLieu.DataSource = dsTl; DataBind(); } else { LoadData(); } }