protected void GridViewTAPTINBAIVIET_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "XoaFile") { // Convert the row index stored in the CommandArgument // property to an Integer. int index = Convert.ToInt32(e.CommandArgument); List<TAPTINBAIVIET> lt = new List<TAPTINBAIVIET>(); BUSTapTinBaiViet BUSTapTinBaiViet = new BUSTapTinBaiViet(); lt = BUSTapTinBaiViet.getLichLamViec(); XoaFile_Click(lt[index].TenTapTin); } }
//Load public int LoadTAPTINBAIVIET() { List<TAPTINBAIVIET> lt = new List<TAPTINBAIVIET>(); BUSTapTinBaiViet BUSTapTinBaiViet = new BUSTapTinBaiViet(); lt = BUSTapTinBaiViet.getLichLamViec(); if (lt.Count > 0) { this.GridViewLichLamViec.DataSource = lt; GridViewLichLamViec.DataBind(); PanelDanhSach.Visible = true; PanelMessage.Visible = false; return lt.Count; } else { PanelDanhSach.Visible = false; PanelMessage.Visible = true; return 0; } }