コード例 #1
0
        private void tsAddClass_Click(object sender, EventArgs e)
        {
            frmClass        frm             = new frmClass();
            ClassController classController = new ClassController();
            Class           addClass        = new Class();

lap:
            frm.SetInPut(addClass);
            frm.ShowDialog();
            if (frm.DialogResult == DialogResult.OK)
            {
                addClass = frm.getClass();
                if (classController.Insert(addClass) == 1)
                {
                }
                else
                {
                    MessageBox.Show("Lớp đã tồn tại.");
                    goto lap;
                }
                showTreeView();
            }
        }