private void button1_Click(object sender, EventArgs e)
 {
     if (txtmk.Text != "" && txttk.Text != "" && checkMaK1.ErrorMessage == null && checkTenK1.ErrorMessage == null)
     {
         ClassDTO kl = new ClassDTO(txtmk.Text, txttk.Text);
         HSB.InsertKL(kl);
         HSB.Loadkl();
         MessageBox.Show("successfull");
     }
     else
     {
         MessageBox.Show("vui lòng nhập đúng và đủ ");
     }
 }
        private void TongKetMon_Load(object sender, EventArgs e)
        {
            HSB.Loadkl();
            HSB.loadnohk();
            HSB.loadBCM();
            List <string> NH = new List <string>();

            foreach (var s in HocKi.HK)
            {
                int    k   = 1;
                string x   = s.MaHK1.ToString();
                char[] ar  = x.ToCharArray();
                string nam = ar[1].ToString() + ar[2].ToString() + ar[3].ToString() + ar[4].ToString();
                for (int o = 0; o < NH.Count(); o++)
                {
                    if (nam == NH[o])
                    {
                        k = 0;
                    }
                }
                if (k == 1)
                {
                    NH.Add(nam);
                }
            }

            namhoccombo.DataSource = NH.ToList();
        }
        private void MainGUI_Load(object sender, EventArgs e)
        {
            HSB.Loadkl();
            List <string> l = new List <string>();

            foreach (var s in clasDTO.lop)
            {
                l.Add(s.TenL1);
            }
            dslopcbox.DataSource = l.ToList();
        }
Exemple #4
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (classcombo.SelectedItem != null)
     {
         MessageBox.Show("Chỉ được xóa những khối lớp không có lớp ");
     }
     else
     {
         foreach (var s in ClassDTO.khoilop)
         {
             if (s.TenK1 == kLcombo.SelectedItem.ToString())
             {
                 HSB.DelKL(s.MaK1);
                 HSB.Load();
                 HSB.loadBCM();
                 HSB.Loadkl();
                 MessageBox.Show("successful");
                 break;
             }
         }
     }
 }
Exemple #5
0
        private void MonHoc_Load(object sender, EventArgs e)
        {
            HSB.Loadkl();
            HSB.loadnohk();
            HSB.loadBCM();
            List <string> l = new List <string>();

            foreach (var s in clasDTO.lop)
            {
                l.Add(s.TenL1);
            }
            dslopcbox.DataSource = l.ToList();
            hkcombo.SelectedItem = null;
            bool i = HSB.Checkhk();

            if (i == true)
            {
                panel1.Visible  = true;
                label1.Visible  = false;
                button1.Visible = false;
                namhoc.Visible  = false;
                label1.Visible  = false;
                label2.Visible  = false;
                label3.Visible  = false;
                hkcombo.Visible = false;
            }
            List <string> NH = new List <string>();

            foreach (var s in HocKi.HK)
            {
                int    k   = 1;
                string x   = s.MaHK1.ToString();
                char[] ar  = x.ToCharArray();
                string nam = ar[1].ToString() + ar[2].ToString() + ar[3].ToString() + ar[4].ToString();
                for (int o = 0; o < NH.Count(); o++)
                {
                    if (nam == NH[o])
                    {
                        k = 0;
                    }
                }
                if (k == 1)
                {
                    NH.Add(nam);
                }
            }

            namhoccombo.DataSource = NH.ToList();
            yearcombo.DataSource   = NH.ToList();

            foreach (var s in CTMonHoc.noneHK)
            {
                DataGridViewRow row = new DataGridViewRow();

                DataGridViewCell cell = new DataGridViewTextBoxCell();
                cell.Value = s.MaMon1;
                row.Cells.Add(cell);
                cell       = new DataGridViewTextBoxCell();
                cell.Value = s.TenMon1;
                row.Cells.Add(cell);

                mhnothkgrid.Rows.Add(row);
            }
        }
Exemple #6
0
        public void MainGUI_Load(object sender, EventArgs e)
        {
            HSB.TLSL();
            HSB.Loadkl();
            HSB.AVG();

            List <string> l = new List <string>();

            foreach (var s in clasDTO.lop)
            {
                l.Add(s.TenL1);
            }
            dslopcbox.DataSource = l.ToList();

            if (UsserrDTO.u.Per != 0)
            {
                button14.Visible = true;
            }

            if (UsserrDTO.u.Per == 0)
            {
                pictureBox3.Visible = false;

                button1.Visible = false;
                button2.Visible = false;
                button3.Visible = false;
                button4.Visible = false;
                button5.Visible = false;
                button6.Visible = false;
                button7.Visible = false;
                button9.Visible = true;
                showinpanel(new DSclass());
            }
            else
            {
                if (UsserrDTO.u.Per == 1)
                {
                    pictureBox3.Visible = false;

                    button1.Visible  = false;
                    button2.Visible  = false;
                    button3.Visible  = false;
                    button4.Visible  = false;
                    button5.Visible  = false;
                    button6.Visible  = false;
                    button7.Visible  = false;
                    button8.Visible  = false;
                    button9.Visible  = false;
                    button10.Visible = true;
                }
                else
                {
                    if (UsserrDTO.u.Per == 2)
                    {
                        button1.Visible  = false;
                        button2.Visible  = false;
                        button3.Visible  = false;
                        button4.Visible  = false;
                        button5.Visible  = false;
                        button6.Visible  = false;
                        button7.Visible  = false;
                        button8.Visible  = false;
                        button9.Visible  = true;
                        button11.Visible = true;
                        button12.Visible = true;
                        button13.Visible = true;
                    }
                }
            }
        }