Ejemplo n.º 1
0
        private void InitalizeComboBoxLanThi()
        {
            int nSoLanThi = NhapDiemBUL.LoadLanThi(m_strMaMonHoc, m_strMaLop).Count;

            if (nSoLanThi == 0)
            {
                //Không có lần thi nào
                cbxLanThu.Items.Clear();
                cbxLanThu.Items.Add("Lần 1");
                cbxLanThu.SelectedIndex = 0;
            }

            if (nSoLanThi == 1 || nSoLanThi == 2)
            {
                // Có 1 lần thi hoặc 2 lần thi
                cbxLanThu.Items.Clear();
                cbxLanThu.Items.Add("Lần 1");
                cbxLanThu.Items.Add("Lần 2");
                cbxLanThu.SelectedIndex = 0;
            }
        }
Ejemplo n.º 2
0
        private Action CanInsertOrUpdateBangDiem()
        {
            List <string> lstLanThi = NhapDiemBUL.LoadLanThi(m_strMaMonHoc, m_strMaLop);

            if (lstLanThi == null)
            {
                //TODO:
                return(Action.Unknown);
            }

            int nSoLanThi = lstLanThi.Count;

            if (m_nLanThi == 1 && nSoLanThi == 0)
            {
                return(Action.Insert);
            }

            if (m_nLanThi == 1 && nSoLanThi == 1)
            {
                return(Action.Update);
            }

            if (m_nLanThi == 1 && nSoLanThi == 2)
            {
                return(Action.NotAllow);
            }

            if (m_nLanThi == 2 && nSoLanThi == 1)
            {
                return(Action.Insert);
            }

            if (m_nLanThi == 2 && nSoLanThi == 2)
            {
                return(Action.Update);
            }
            return(Action.Unknown);
        }