c# - 我可以使用哪些工具箱项来管理数据库列表?
问题描述
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
public List<Medication> Medications { get; set; }
}
public class Medication
{
public int Id { get; set; }
public string Name { get; set; }
}
我可以使用什么来为每位客户添加/移除药物?我试图创建一个 CheckListBox,但我无法将选中的项目保存给客户,还有其他选项可以管理这样的列表吗?我已经创建了几种药物,但现在我想将多个药物绑定到每个客户
解决方案
对此的众多解决方案之一是:
- 创建拆分容器(垂直)
- 在左侧创建 ListBox,您将在其中禁用多选
- 在右侧创建 CheckListBox
ListBox 将Customer Name
作为显示值和Customer Id
值成员保存。
OnSelectedItemChange
里面的事件listBox
将为客户处理药物。
当您单击其他客户时,事件运行命令将首先获取List<Medication>
特定Customer Id
然后显示在右侧。
其他更改的处理是非常基本的。
再一次,这个问题是基于意见的,这是我的意见。
推荐阅读
- html - 如何将响应式 CSS 网格折叠为 2 列而不是 1 列?
- python - Pythonic 相当于 Proc Servey Freq?
- list - 在 Flutter 中可以使用 ListView 的搜索栏吗?
- php - PHP DOMDocument 提取元素并创建新文档
- javascript - 我无法在 ReactJS 中正确使用 history.push()
- ios - UIScrollView 内的嵌套 UIStackViews:不填充容器的宽度?
- android - 无法从广播接收器更改文本视图中的文本
- powerbi - 如何在 PowerBI 查询中正确使用可变月份列?
- sql-server - 在 Azure Data Studio 1.9.0 中选择查询快捷方式
- node.js - 如何解决 Uncaught ReferenceError: COLLECTION is not defined at
:1:1 在 Meteor.js/MongoDB