库存系统db,c# [英] Inventory system db ,c#

查看:100
本文介绍了库存系统db,c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用c#进行库存管理系统工作一个月,它有库存管理,所以我们可以添加我们手中有多少的物品但是当我从购买表中出售它时如何减少其数量来自数据库。

抱歉我的英语不好。



我尝试过的事情:



我试图从数据库和-1项中选择项目数量,然后再将其插入数据库但我确定这不是正确的方法

解决方案

要更新数量,只需运行UPDATE sql语句。非常简单:

 更新产品
SET 数量=数量 - 1
WHERE product_id = @ PRODUCT_ID


It is been a month i am working on inventory management system using c#, it has stock managment to so we can add items that how much we have in our hand but when i sell it from purchase form how to cut down its quantity from database.
Sorry for my bad english.

What I have tried:

I tried to select item quantity from database and -1 items and then insert it to database again but i am sure this is not the right way

解决方案

To update the quantity, just run an UPDATE sql statement. Very simple:

UPDATE products
SET quantity = quantity - 1
WHERE product_id = @product_id


这篇关于库存系统db,c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆