// GET: Admin/KetQua public ActionResult Index(int page = 1, int pageSize = 10) { KetQuaData qk = new KetQuaData(); var model = qk.ListKetQua(page, pageSize); return(View(model)); }
/// <summary> /// /// </summary> /// <returns></returns> public string LayMaCuoi() { if (this.Data == null) { this.Data = new KetQuaData(); } return(Convert.ToString(this.Data.LayMaCuoi())); }
/// <summary> /// /// </summary> /// <param name="cmb"></param> public void HienThiCombobox(ComboBox cmb) { if (this.Data == null) { this.Data = new KetQuaData(); } cmb.DataSource = this.Data.LayDS(); cmb.DisplayMember = "TenKetQua"; cmb.ValueMember = "MaKetQua"; }
/// <summary> /// /// </summary> /// <param name="col"></param> public void HienThiDataGridComboBoxColumn(DataGridViewComboBoxColumn col) { if (this.Data == null) { this.Data = new KetQuaData(); } col.DataSource = this.Data.LayDS(); col.DisplayMember = "TenKetQua"; col.ValueMember = "MaKetQua"; col.DataPropertyName = "MaKetQua"; }
/// <summary> /// /// </summary> /// <param name="dg"></param> /// <param name="bn"></param> public void HienThiDS(DataGridView dgvDS, BindingNavigator bnDS) { if (this.Data == null) { this.Data = new KetQuaData(); } BindingSource bs = new BindingSource(); bs.DataSource = this.Data.LayDS(); bnDS.BindingSource = bs; dgvDS.DataSource = bs; }
public ActionResult Delete(int id, FormCollection collection) { try { // TODO: Add delete logic here KetQuaData kq = new KetQuaData(); kq.Delete(id); return(RedirectToAction("Index")); } catch { return(View()); } }
public KetQuaController() { this.Data = new KetQuaData(); }