public void HienThiComboBox(ComboBoxEx comboBox) { HocKyData m_HKData = new HocKyData(); comboBox.DataSource = m_HKData.LayDsHocKy(); comboBox.DisplayMember = "TenHocKy"; comboBox.ValueMember = "MaHocKy"; }
/// <summary> /// /// </summary> /// <returns></returns> public string LayMaCuoi() { if (this.Data == null) { this.Data = new HocKyData(); } return(Convert.ToString(this.Data.LayMaCuoi())); }
/// <summary> /// /// </summary> /// <param name="cmb"></param> public void HienThiCombobox(ComboBox cmb) { if (this.Data == null) { this.Data = new HocKyData(); } cmb.DataSource = this.Data.LayDS(); cmb.DisplayMember = "TenHocKy"; cmb.ValueMember = "MaHocKy"; }
/// <summary> /// /// </summary> /// <param name="col"></param> public void HienThiDataGridComboBoxColumn(DataGridViewComboBoxColumn col) { if (this.Data == null) { this.Data = new HocKyData(); } col.DataSource = this.Data.LayDS(); col.DisplayMember = "TenHocKy"; col.ValueMember = "MaHocKy"; col.DataPropertyName = "MaHocKy"; }
/// <summary> /// /// </summary> /// <param name="dg"></param> /// <param name="bn"></param> public void HienThiDS(DataGridView dgvDS, BindingNavigator bnDS) { if (this.Data == null) { this.Data = new HocKyData(); } BindingSource bs = new BindingSource(); bs.DataSource = this.Data.LayDS(); bnDS.BindingSource = bs; dgvDS.DataSource = bs; }
/// <summary> /// Lấy thông tin 2 học kỳ tương ứng với niên học /// </summary> /// <param name="maNienHoc"></param> /// <returns></returns> public HocKyInfo[] LayThongTinHocKy(string maNienHoc) { DataTable table = new HocKyData().BangHocKy(maNienHoc); HocKyInfo[] hocKyInfo = new HocKyInfo[table.Rows.Count]; for (int i = 0; i < table.Rows.Count; i++) { hocKyInfo[i] = new HocKyInfo(); hocKyInfo[i].Id = Convert.ToInt32(table.Rows[i]["ma_hoc_ky"]); hocKyInfo[i].TenHocKy = Convert.ToString(table.Rows[i]["ten_hoc_ky"]); hocKyInfo[i].ThoiGianBatDau = Convert.ToDateTime(Convert.ToDateTime(table.Rows[i]["tg_bat_dau"]).ToString("dd/MM/yyyy")); hocKyInfo[i].ThoiGianKetThuc = Convert.ToDateTime(Convert.ToDateTime(table.Rows[i]["tg_ket_thuc"]).ToString("dd/MM/yyyy")); hocKyInfo[i].MaNienhoc = Convert.ToString(table.Rows[i]["ma_nien_hoc"]); } return(hocKyInfo); }
public HocKyInfo LayTuMa(string maHocKy) { if (this.Data == null) { this.Data = new HocKyData(); } DataTable table = this.Data.LayTuMa(maHocKy); if (table.Rows.Count > 0) { HocKyInfo hocKyInfo = new HocKyInfo(); hocKyInfo.MaHocKy = table.Rows[0]["MaHocKy"].ToString(); hocKyInfo.TenHocKy = table.Rows[0]["TenHocKy"].ToString(); hocKyInfo.HeSo = int.Parse(table.Rows[0]["HeSo"].ToString()); return(hocKyInfo); } return(null); }
public HocKyController() { this.Data = new HocKyData(); }