private void EditInterfaceLibrary()
        {
            if (!RadGridViewProperties.IsSelectRow(this.radGridView1))
            {
                return;
            }
            var plugNo = this.radGridView1.CurrentRow.Cells[1].Value;

            if (plugNo != null)
            {
                plugNo = plugNo.ToString();
            }
            else
            {
                MessageBox.Show("请选择要编辑的行!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            RadUpdateInterface radUpdateInterface = new RadUpdateInterface("编辑接口库", plugNo.ToString(), true);

            if (radUpdateInterface.ShowDialog() == DialogResult.OK)
            {
                QueryInterfaceInfo();
                UserOperateRecord.UpdateOperateRecord($"编辑接口");
            }
        }
        private void Btn_deleteProject_Click(object sender, EventArgs e)
        {
            var b = RadGridViewProperties.IsSelectRow(this.radGridView1);

            if (!b)
            {
                MessageBox.Show("请选择要删除的项目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            var selectProject = this.radGridView1.CurrentRow.Cells[1].Value.ToString();

            if (MessageBox.Show($"确定要删除项目{selectProject}?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) != DialogResult.OK)
            {
                return;
            }
            var delRow = projectInfoManager.DeleteByWhere($"where ProjectName = '{selectProject}'");

            if (delRow > 0)
            {
                UserOperateRecord.UpdateOperateRecord($"删除项目{selectProject}");
                MessageBox.Show($"已删除项目{selectProject}!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            QueryProjectInfo();
            //this.DialogResult = DialogResult.OK;
            operateType = OperateType.DeleteProject;
        }
示例#3
0
        private void Menu_commit_Click(object sender, EventArgs e)
        {
            var curIndex = this.radGridView1.CurrentRow.Index;

            if (curIndex < 0)
            {
                MessageBox.Show("未选择要删除的角色!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            var roleName = this.radGridView1.CurrentRow.Cells[1].Value.ToString();

            if (roleName == "管理员")
            {
                return;//系统管理员不可编辑修改
            }
            var remark    = this.radGridView1.CurrentRow.Cells[2].Value;
            var remarkStr = "";

            if (remark != null)
            {
                remarkStr = remark.ToString();
            }
            var      id       = GetRoleID(roleName);
            EditRole editRole = new EditRole("编辑角色", roleName, remarkStr);

            if (editRole.ShowDialog() == DialogResult.OK)
            {
                var date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                this.roleManager.UpdateFields($"UserRole='{editRole.roleName}',Remark='{editRole.roleRemark}',UpdateDate='{date}'", $"where ID='{id}'");
                UserOperateRecord.UpdateOperateRecord($"修改角色-{editRole.roleName}");
                QueryRoleInfo();
            }
        }
示例#4
0
        private void Menu_del_Click(object sender, EventArgs e)
        {
            var curIndex = this.radGridView1.CurrentRow.Index;

            if (curIndex < 0)
            {
                MessageBox.Show("未选择要删除的角色!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            var roleName = this.radGridView1.CurrentRow.Cells[1].Value.ToString();

            if (roleName == "管理员")
            {
                return;//系统管理员不可删除
            }
            if (MessageBox.Show("确定要删除该角色吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) != DialogResult.Yes)
            {
                return;
            }
            var res = this.roleManager.DeleteByWhere($"where UserRole='{roleName}'");

            if (res > 0)
            {
                UserOperateRecord.UpdateOperateRecord($"删除角色-{roleName}");
                MessageBox.Show($"已删除角色'{roleName}'!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            QueryRoleInfo();
        }
        private void Tool_add_Click(object sender, EventArgs e)
        {
            RadUpdateInterface radUpdateInterface = new RadUpdateInterface("添加接口库", "", false);

            if (radUpdateInterface.ShowDialog() == DialogResult.OK)
            {
                QueryInterfaceInfo();
                UserOperateRecord.UpdateOperateRecord($"添加接口");
            }
        }
        private void Menu_delAll_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show($"确定要删除所有项目?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) != DialogResult.OK)
            {
                return;
            }
            var delRow = projectInfoManager.DeleteByWhere("");

            if (delRow > 0)
            {
                UserOperateRecord.UpdateOperateRecord($"删除所有项目");
                MessageBox.Show($"已删除所有项目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            QueryProjectInfo();
            //this.DialogResult = DialogResult.OK;
            operateType = OperateType.DeleteProject;
        }
示例#7
0
        private void Menu_add_Click(object sender, EventArgs e)
        {
            EditRole editRole = new EditRole("新增角色", "", "");

            if (editRole.ShowDialog() == DialogResult.OK)
            {
                this.roleEntity.ID         = TablePrimaryKey.InsertRolePID();
                this.roleEntity.UserRole   = editRole.roleName;
                this.roleEntity.Remark     = editRole.roleRemark;
                this.roleEntity.UpdateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                var cCount = roleManager.Insert(this.roleEntity);
                if (cCount > 0)
                {
                    UserOperateRecord.UpdateOperateRecord($"新增角色-{roleEntity.UserRole}");
                    QueryRoleInfo();
                }
            }
        }
        private void Tool_delete_Click(object sender, EventArgs e)
        {
            if (!RadGridViewProperties.IsSelectRow(this.radGridView1))
            {
                return;
            }
            var plugNo = this.radGridView1.CurrentRow.Cells[1].Value.ToString();

            if (IsInterUsed(plugNo))
            {
                MessageBox.Show($"接口{plugNo}已被线束库使用,删除失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (MessageBox.Show($"确认要删除接口{plugNo}?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            {
                plugLibraryDetailManager.DeleteByWhere($"where InterfaceNo='{plugNo}'");
                QueryInterfaceInfo();
                UserOperateRecord.UpdateOperateRecord($"删除接口{plugNo}");
            }
        }