关于最后一个答案的答复 [英] reply regarding the last answer
问题描述
这是更新库存条目的唯一方法
Is this the only way to update the stock entry
推荐答案
您好
First off you should not write a post like this without the former post here. If I didn't reply to the other post I would of had to search.
为回答您的问题,您可以使用Entity Framework进行此操作,该实体框架最初具有安装过程,因此您不应将其与SqlClient数据提供程序混合使用.有TableAdapter或DataAdapter方法,它们也可能有问题.
In reply to your question, you could do this with Entity Framework which initially there is a setup process along with you should not mix it with SqlClient data provider. There are TableAdapter or DataAdapter methods and they can be problematic also.
简而言之,无论走哪条路,底层逻辑都保持不变,检查当前数量,确定是否有可能订购,然后对该逻辑进行减去或拒绝.
In short, the underly logic remains the same no matter which way you go, check the current quantity, determine if it's possible to order then act upon that logic to subtract or deny.
我个人使用的是Entity Framework,如果不使用Entity Framework,我将与我展示的内容保持一致.
Personally I use Entity Framework, if not using Entity Framework I would go with that I showed.
要了解如何在Windows窗体解决方案中使用Entity Framework,请参阅以下内容 我做了 MSDN代码示例.请注意,我在此代码示例中使用了高级方法,因此不适用于初学者.使用DTO(数据传输对象),也使用自定义BindingList.
To get an idea how to use Entity Framework in a Windows form solution see the follow MSDN code sample I did. Note I use advance methods within this code sample so it's not for beginners e.g. DTO (Data Transfer Objects) are used, custom BindingList also.
这篇关于关于最后一个答案的答复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!