//Hiển Thị Form Input private void ShowFormInput() { if (Page.RouteData.Values["ID"] != null) { btnThem.Visible = false; btnCapNhat.Visible = true; btnXoa.Visible = true; string id = Page.RouteData.Values["ID"].ToString().Trim(); NhomSach _ns = tbl_ns.GetByID(id); txtTenNhom.Text = _ns.TenNhom; } else { btnThem.Visible = true; btnCapNhat.Visible = false; btnXoa.Visible = false; } }
public void DatalistPaging() { PagedDataSource PD = new PagedDataSource(); string id = Page.RouteData.Values["modul"].ToString().Trim(); NhomSach ns = tbl_ns.GetByID(id); PD.DataSource = tbl_sach.GroupBook(ns.TenNhom); PD.PageSize = 21; PD.AllowPaging = true; PD.CurrentPageIndex = CurrentPage; if (PD.PageCount > 1) { Repeater1.Visible = true; System.Collections.ArrayList pages = new System.Collections.ArrayList(); int cout = 0; for (int i = CurrentPage - 5; i <= CurrentPage + 10; i++) { if (i > PD.PageCount) { break; } if (i > 0) { if (cout < 10) { cout++; pages.Add(i.ToString()); } else { break; } } } Repeater1.DataSource = pages; Repeater1.DataBind(); } else { Repeater1.Visible = false; } DataList1.DataSource = PD; DataList1.DataBind(); }