问题描述
大家好
我有一张叫CompanyDetails的表.
I have one table called CompanyDetails.
我希望用户仅一次输入公司数据,而不是一次. (但是用户可以更新该数据)
I want user to entry company data only one time not more then one. (But user can update that data)
我该如何在LS中做到这一点?
How can i do that in LS?
这个问题有解决方案吗?
Is there any solution for this issue?
请帮助我.
推荐答案
不在我的头上(即未经测试):
Off the top of my head (i.e. not tested):
创建修改详细信息"屏幕上要编辑的实体.在VS中打开屏幕时,您会看到它具有一个参数(在屏幕左侧的列表中,它带有一个小的蓝色框图标标记).您还将看到的参数 您正在编辑的实体已与此屏幕参数绑定.
Create an "Edit details" screen for the entity you want to edit. When you open the screen in VS, you'll see it has a parameter (on the list on the left hand side of the screen it is marked with a small blue box icon). You'll also see that the parameter of the entity you are editing is bound to this screen parameter.
尝试取消选中是参数";屏幕参数的属性"属性,而是通过屏幕的InitializeDataWorkspace事件设置屏幕参数的值.如果您使用的是int主键,则该值通常为1.您可能还必须 添加一些代码以创建公司详细信息实例(如果不存在).
Try to uncheck the "Is Parameter" property for the screen parameter and instead set the value of the screen parameter from the InitializeDataWorkspace event of your screen. If you are using int primary keys, the value is typically 1. You may also have to add some code to create an instance of your company details if none exist.
祝你好运:-)
祝一切顺利,
符文
All the best,
Rune
这篇关于如何限制用户在Lightswitch中添加数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!