Exemplo n.º 1
0
 private void BtnAddCategories_Click(object sender, EventArgs e)
 {
     TbDe.Enabled   = true;
     TbID.Enabled   = false;
     TbName.Enabled = true;
     BtnOk.Enabled  = true;
     BtnOk.Text     = "添加";
     op             = "add";
     LbTip.Text     = "当前操作模式:添加";
     TextBoxEmpty();
     TbID.Text = GuGuGuHelper.GetCategoryID();
 }
Exemplo n.º 2
0
        private void Insert()
        {
            string sql = string.Format("insert into Categories values('{0}','{1}','{2}')", TbID.Text.Trim(), TbName.Text.Trim(), TbDe.Text);
            int    cnt = GuGuGuHelper.ExecuteNonQuery(sql);

            if (cnt >= 1)
            {
                MessageBox.Show("插入成功");
            }
            else
            {
                MessageBox.Show("插入失败");
            }
            TbID.Text = GuGuGuHelper.GetCategoryID();
            CateRefresh();
        }