public void LoadLoaiHoatDong() { BUSLoaiHoatDong BUSLoaiHoatDong = new BUSLoaiHoatDong(); List<LOAIHOATDONG> LOAIHOATDONG = BUSLoaiHoatDong.SelectLOAIHOATDONGsAll(); ddlLoaiHoatDong.DataSource = LOAIHOATDONG; ddlLoaiHoatDong.DataTextField = "TenLoaiHoatDong"; ddlLoaiHoatDong.DataValueField = "MaLoaiHoatDong"; ddlLoaiHoatDong.DataBind(); }
//Load public int LoadLoaiHoatDong() { List<LOAIHOATDONG> lt = new List<LOAIHOATDONG>(); BUSLoaiHoatDong BUSLoaiHoatDong = new BUSLoaiHoatDong(); lt = BUSLoaiHoatDong.SelectLOAIHOATDONGsAll (); if (lt.Count > 0) { this.GridViewLoaiHoatDong.DataSource = lt; GridViewLoaiHoatDong.DataBind(); PanelDanhSach.Visible = true; PanelMessage.Visible = false; return lt.Count; } else { PanelDanhSach.Visible = false; PanelMessage.Visible = true; return 0; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //Do loai hoat dong BUSLoaiHoatDong BUSLoaiHoatDong = new BUSLoaiHoatDong(); ddlLoaiHoatDong.DataSource = BUSLoaiHoatDong.SelectLOAIHOATDONGsAll(); ddlLoaiHoatDong.DataTextField = "TenLoaiHoatDong"; ddlLoaiHoatDong.DataValueField = "MaLoaiHoatDong"; ddlLoaiHoatDong.DataBind(); if (Request.QueryString["id"] != null) { LoadHoatDong(); } } }