Esempio n. 1
0
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            ConnDB conn = new ConnDB();
            string strsql, strsql2;
            int    rows;

            strsql  = "insert into cost_role(CNAME) values('" + textEditName.Text.ToString().Trim() + "')";
            strsql2 = "select cname from cost_role where cname = '" + textEditName.Text.ToString().Trim() + "'";
            if (textEditName.Text.ToString().Trim() != "")
            {
                rows = conn.ReturnRecordCount(strsql2);
                if (rows > 0)
                {
                    MessageBox.Show("该角色已经存在!");
                }
                else
                {
                    bool isok = conn.EditDatabase(strsql);
                    if (isok)
                    {
                        MessageBox.Show("添加成功!");
                        RoleQuery.RefreshEX();
                        this.Close();
                    }
                }
            }
            else
            {
                MessageBox.Show("名称不能为空!");
            }
            conn.Close();
        }
Esempio n. 2
0
 private void barButtonItem刷新_ItemClick(object sender, ItemClickEventArgs e)
 {
     RoleQuery.RefreshEX();
 }
Esempio n. 3
0
 private void barButtonItem反禁用_ItemClick(object sender, ItemClickEventArgs e)
 {
     RoleQuery.cEnable();
     RoleQuery.RefreshEX();
 }