예제 #1
0
        private void btn_Del_Click(object sender, EventArgs e)
        {
            if (this.deviceAuthorizeList.SelectedRows.Count <= 0)
            {
                MessageBox.Show("请选择要删除的群组");
                return;
            }
            else
            {
                if (MessageBox.Show("确定要将群组" + deviceAuthorizeList.SelectedRows[0].Cells[1].Value + "从设备" + lab_DeviceName.Text + "删除?", "删除权限", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }

                DAL.DAL_Authorize authrize = new DAL.DAL_Authorize();

                if (authrize.DeleteGroupAuthrize(deviceAuthorizeList.SelectedRows[0].Cells[0].Value.ToString()))
                {
                    MessageBox.Show("删除群组成功!");
                    GetDeviceAuthorizeList("");
                }
                else
                {
                    MessageBox.Show("删除群组失败!");
                }
            }
        }
예제 #2
0
        private void btn_DeleteAuthrize_Click(object sender, EventArgs e)
        {
            if (AuthrizeGroupHave.SelectedRows != null)
            {
                if (MessageBox.Show("你确定要为分组" + lab_groupname.Text + "删除设备:" + AuthrizeGroupHave.SelectedRows[0].Cells[1].Value + "的权限吗?", "添加权限", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    DAL.DAL_Authorize authorizedal = new DAL.DAL_Authorize();

                    if (authorizedal.DeleteGroupAuthrize(AuthrizeGroupHave.SelectedRows[0].Cells[0].Value.ToString()))
                    {
                        MessageBox.Show("删除成功");
                        GetGroupAuthrize();
                    }
                    else
                    {
                        MessageBox.Show("删除失败");
                    }
                }
            }
        }