Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            string mk = mkcombo.SelectedItem.ToString();

            MessageBox.Show(mk);
            char[] ar   = mk.ToCharArray();
            string test = ar[1].ToString() + ar[2].ToString();

            if (txtml.Text != "" && txtlop.Text != "" && txtss.Text != "" && checkMaL1.ErrorMessage == null && checkTenL1.ErrorMessage == null)
            {
                char[] ar2   = txtlop.Text.ToCharArray();
                string test2 = ar2[0].ToString() + ar2[1].ToString();

                if (test != test2)
                {
                    MessageBox.Show("vui lòng nhập tên lớp phù hợp với  khối");
                }
                else
                {
                    clasDTO lopp = new clasDTO(txtml.Text, txtlop.Text, int.Parse(txtss.Text), mk);
                    HSB.InsertL(lopp);
                    HSB.Loadkl();
                    MessageBox.Show("successfull");
                }
            }
            else
            {
                MessageBox.Show("vui lòng nhập đầy đủ ");
            }
        }