Ejemplo n.º 1
0
        private void btOk_Click(object sender, EventArgs e)
        {
            string  findSql   = "select * from DT_career where classnum ='" + tBcnu.Text + "'";
            string  insertSql = "insert into DT_career" + "(classnum,classname)" + "values('" + tBcnu.Text + "','" + tbCna.Text + "')";
            SqlHelp sqlHelper = new TryDBMS.SqlHelp();
            int     count1    = sqlHelper.SqlServerRecordCount(findSql);

            if (count1 > 0)
            {
                wrong1();
            }
            int count2 = sqlHelper.ExecuteNonQueryCount(insertSql);

            if (count2 > 0)
            {
                right();
            }
            Hide();
        }