/// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public string LayMaCuoi()
 {
     if (this.Data == null)
     {
         this.Data = new HocLucData();
     }
     return(Convert.ToString(this.Data.LayMaCuoi()));
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="cmb"></param>
 public void HienThiCombobox(ComboBox cmb)
 {
     if (this.Data == null)
     {
         this.Data = new HocLucData();
     }
     cmb.DataSource    = this.Data.LayDS();
     cmb.DisplayMember = "TenHocLuc";
     cmb.ValueMember   = "MaHocLuc";
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="col"></param>
 public void HienThiDataGridComboBoxColumn(DataGridViewComboBoxColumn col)
 {
     if (this.Data == null)
     {
         this.Data = new HocLucData();
     }
     col.DataSource       = this.Data.LayDS();
     col.DisplayMember    = "TenHocLuc";
     col.ValueMember      = "MaHocLuc";
     col.DataPropertyName = "MaHocLuc";
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="dg"></param>
        /// <param name="bn"></param>
        public void HienThiDS(DataGridView dgvDS, BindingNavigator bnDS)
        {
            if (this.Data == null)
            {
                this.Data = new HocLucData();
            }

            BindingSource bs = new BindingSource();

            bs.DataSource      = this.Data.LayDS();
            bnDS.BindingSource = bs;
            dgvDS.DataSource   = bs;
        }
Ejemplo n.º 5
0
        public String XepLoaiHocLucMonHoc(float[] arrayDiemTBTungMon, float tongDiem)
        {
            String xepLoai          = "";
            float  diemTBMonNhoNhat = arrayDiemTBTungMon[0];

            for (int i = 0; i < arrayDiemTBTungMon.Length - 1; i++)
            {
                if (arrayDiemTBTungMon[i] < diemTBMonNhoNhat)
                {
                    diemTBMonNhoNhat = arrayDiemTBTungMon[i];
                }
            }

            HocLucData m_HLData = new HocLucData();
            DataTable  m_DT     = m_HLData.LayDsHocLuc();

            String[] maHocLuc    = new String[m_DT.Rows.Count];
            float[]  diemCanDuoi = new float[m_DT.Rows.Count];

            int count = 0;

            foreach (DataRow row in m_DT.Rows)
            {
                maHocLuc[count]    = row["MaHocLuc"].ToString();
                diemCanDuoi[count] = float.Parse(row["DiemCanDuoi"].ToString());
                count++;
            }

            for (int i = 0; i < count - 1; i++)
            {
                if (tongDiem >= diemCanDuoi[i] && diemTBMonNhoNhat >= diemCanDuoi[i + 1])
                {
                    xepLoai = maHocLuc[i];
                    break;
                }
            }

            if (xepLoai == "")
            {
                xepLoai = maHocLuc[count - 1].ToString();
            }
            return(xepLoai);
        }
 public HocLucController()
 {
     this.Data = new HocLucData();
 }