private void btnSave_Click(object sender, EventArgs e) { if (this.lueAddRole.EditValue == null) { XtraMessageBox.Show("role is empty!!", "提示", MessageBoxButtons.OK); return; } if (this.tllueAddMenu.EditValue == null) { XtraMessageBox.Show("menu is empty!", "提示", MessageBoxButtons.OK); return; } if (this.lueAuthority.EditValue == null) { XtraMessageBox.Show("Authority is empty!", "提示", MessageBoxButtons.OK); return; } RoleMenuAuthoritiesVM vm = new RoleMenuAuthoritiesVM() { RoleID = (this.lueAddRole.EditValue as RolesVM).ID, MenuID = (this.tllueAddMenu.EditValue as RoleMenusVM).MenuID, AuthorityID = (this.lueAuthority.EditValue as AuthoritiesVM).ID }; var res = _bll.AddRoleMenuAuthorities(vm); if (res > 0) { XtraMessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK); RequestRoleMenuAuthoritiesData(); } else { XtraMessageBox.Show("保存失败!", "提示", MessageBoxButtons.OK); } }