将 FormView 用于 LINQ 实体,该实体还具有要在任何表单操作上更新的子实体集
我想要使用 FormView 更新的基本 linq 实体是“Job”,我可以简单地添加 FormView 来操作其所有 CRUD 操作。但是,在 Job(1)-JobExpertise(n) 关系中,还有另一个实体“JobExpertise”作为此“Job”实体的子级。我还想将此 JobExpertise 作为同一表单上的子行进行操作。
因此,当执行任何 FormView 操作(即插入/更新/删除)时。工作连同相关的工作专业知识一起修改。
怎么做呢?我正在使用.NET 3.5
My basic linq entity that I want to update using FormView is 'Job' and I can simply add a FormView to operate all its CRUD operations. However, there is another entity 'JobExpertise' as child to this 'Job' entity, in Job(1)-JobExpertise(n) Relationship. I also want to operate on this JobExpertise as child rows on the same form.
So when any FormView action (i.e. Insert/Update/Delete) is performed. Job is modified along with related JobExpertise.
How to do it? I'm using .NET 3.5
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的场景中,如果是我这样做,我会将作业放在一个表单视图上,然后将其作为 JobExpertises 列表的 DataGrid 和用于在数据网格中选择的项目的另一个 FormView 。
要添加 JobExpertise,您只需将其添加到 Job 对象上的 JobExpertise 实体集合中,当您添加到模型并 SubmitChanges 或保存更改时,它会将此实体添加到您的作业实体中。
更新和删除也应该发生同样的事情。
希望这对您有所帮助。
in your scenario if it was me doing it i would have the Job on one Form View and then a DataGrid that is the list of the JobExpertises and a Another FormView for the item selected in the Data Grid.
To Add a JobExpertise you simply Add it to the Entity Collection of JobExpertise on the Job object, and when you add to the Model and SubmitChanges or Save Changes it will add this entity to your job Entity.
The same thing should happen with Updates and Delete.
Hope this is of some help.