public void GetData(string key = "", string type = "") { Models.HocSinhController hocsinhController = new Models.HocSinhController(); List <Models.HocSinh> hocsinhs = hocsinhController.Get(0, 10); dtgrv.DataSource = hocsinhs; }
public void Hienthi(int start) { hocsinhController = new Models.HocSinhController(); hocsinhs = new List <Models.HocSinh>(); hocsinhs.Clear(); hocsinhs = hocsinhController.Get(start, record); dtgrv.DataSource = hocsinhs; dtgrv.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; foreach (DataGridViewColumn col in dtgrv.Columns) { col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter; col.HeaderCell.Style.Font = new Font("Arial", 12F, FontStyle.Bold, GraphicsUnit.Pixel); } try { dtgrv.CurrentCell = dtgrv[CurCl, CurR]; } catch { } string txtThongTin = string.Format("{0}/{1}", count, GetTongSobanGhi()); lblSoBanGhi.Caption = txtThongTin; lblpage.Caption = string.Format("Trang Số: {0}", page); dtgrv.Refresh(); }
public int GetTongSobanGhi() { hocsinhController = new Models.HocSinhController(); return(hocsinhController.Get(0, 1000).Count); }