/// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmNamHoc_Load(object sender, EventArgs e)
        {
            //Khoi tao doi tuong m_Controller
            if (this.Controller == null)
            {
                this.Controller = new NamHocController();
            }

            this.Controller.HienThiDS(dgvDS, bnDS);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public NamHocInfo PhatSinh()
        {
            string lastID = new NamHocController().LayMaCuoi();
            int    truoc  = int.Parse(lastID.Substring(2, 2));
            int    sau    = int.Parse(lastID.Substring(4, 2));

            truoc++;
            sau++;
            string tenNamHoc = (2000 + truoc).ToString() + " - " + (2000 + sau).ToString();
            string maNamHoc  = "NH" + ((truoc >= 10) ? truoc.ToString() : (100 + truoc).ToString().Substring(1, 2)) +
                               ((sau >= 10) ? sau.ToString() : (100 + sau).ToString().Substring(1, 2));

            return(new NamHocInfo(maNamHoc, tenNamHoc));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmPhanLop_Load(object sender, EventArgs e)
        {
            if (this.KhoiLopControllerCu == null)
            {
                this.KhoiLopControllerCu = new KhoiLopController();
            }
            if (this.LopControllerCu == null)
            {
                this.LopControllerCu = new LopController();
            }
            if (this.HocSinhControllerCu == null)
            {
                this.HocSinhControllerCu = new HocSinhController();
            }
            if (this.PhanLopControllerCu == null)
            {
                this.PhanLopControllerCu = new PhanLopController();
            }

            if (this.NamHocController == null)
            {
                this.NamHocController = new NamHocController();
            }
            if (this.KhoiLopControllerMoi == null)
            {
                this.KhoiLopControllerMoi = new KhoiLopController();
            }
            if (this.LopControllerMoi == null)
            {
                this.LopControllerMoi = new LopController();
            }
            if (this.HocSinhControllerMoi == null)
            {
                this.HocSinhControllerMoi = new HocSinhController();
            }
            if (this.PhanLopControllerMoi == null)
            {
                this.PhanLopControllerMoi = new PhanLopController();
            }

            string     maNamHocMoi   = this.NamHocController.LayMaCuoi();
            string     maNamHocCu    = this.NamHocController.LayMaTruoc(maNamHocMoi);
            NamHocInfo infoNamHocMoi = this.NamHocController.LayTuMa(maNamHocMoi);
            NamHocInfo infoNamHocCu  = this.NamHocController.LayTuMa(maNamHocCu);

            this.gbNamHocCu.Text  = "Năm Học " + infoNamHocCu.TenNamHoc;
            this.gbNamHocCu.Tag   = maNamHocCu;
            this.gbNamHocMoi.Text = "Năm Học " + infoNamHocMoi.TenNamHoc;
            this.gbNamHocMoi.Tag  = maNamHocMoi;

            this.KhoiLopControllerMoi.HienThiCombobox(this.cmbKhoiLopMoi);
            this.KhoiLopControllerCu.HienThiCombobox(this.cmbKhoiLopCu);

            this.cmbKhoiLopMoi.SelectedIndex = 0;
            this.cmbKhoiLopCu.SelectedIndex  = 0;
            if (this.cmbLopMoi.Items.Count > 0)
            {
                this.cmbLopMoi.SelectedIndex = 0;
            }
            if (this.cmbLopCu.Items.Count > 0)
            {
                this.cmbLopCu.SelectedIndex = 0;
            }
        }
 public frmNamHoc(NamHocController nh)
 {
     InitializeComponent();
     this.Controller = nh;
 }
 public frmNamHoc()
 {
     InitializeComponent();
     this.Controller = new NamHocController();
 }