Пример #1
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            string name = tbName.Text.Trim();

            if (name.Length == 0)
            {
                return;
            }
            Learning learner = new Learning(name);

            if (learner.ifExists())
            {
                ShowResult.show(lblResult, "已存在!", false);
                timerClsResult.Start();
                tbName.Clear();
                return;
            }
            learner.add();
            ShowResult.show(lblResult, "已添加!", true);
            timerClsResult.Start();
            refreshDgv();
            tbName.Clear();
        }