如何显示单个项目的详细信息利用它的详细信息? [英] How Do I Show A Single Item's Details Profit With It's Details Too?

查看:82
本文介绍了如何显示单个项目的详细信息利用它的详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候全部,我正在使用VB.NET 2010中的POS系统。我需要使用条形码显示单个项目的利润,但是我还需要检索所有项目的详细信息。我只能从中获取利润,但不能获得商品的详细信息。





[代码来自回答/评论]

Greetings All, I am working on a POS System in VB.NET 2010. i need to display the profit of a single item using barcode which is working but i need also to retrieve all the item's details as well. I can only pull the profit but not with the item's details too.


[Code added from answer/comment]

'Adapter query:

SELECT        SUM((ItemSellPrice - ItemBuyPrice) * ItemCount) AS ItemTotalProfit
FROM            ReceiptDetails
WHERE        (Barcode = ?)

'button Code:
If ComboBox1.Text = "Item Total Profit" Then
            txtRptBarcode.Show()

            Me.ItemTotalProfitTableAdapter.FillByItemTotalProfit(Me.POSDS.ItemTotalProfit, txtRptBarcode.Text)

            ITPRV.Show()

推荐答案

根据你所说的,我相信这个sql查询应该提取所有信息:

Based on what you have said, I believe this sql query should pull all the information:
SELECT SUM((rd.ItemSellPrice - rd.ItemBuyPrice) * rd.ItemCount) AS ItemTotalProfit, i.Barcode, i.ItemName, i.ItemSellPrice
FROM ReceiptDetails as rd join Items as i on rd.Barcode = i.Barcode
WHERE (rd.Barcode = ?) 





我假设条形码,ItemName和ItemSellPrice都是Item表中的所有字段。

您需要扩展数据集以便能够保存这些额外的字段。



让我知道你是怎么回事。



I've assumed that Barcode, ItemName and ItemSellPrice are all fields in the Item table.
You need to extend your dataset to be able to hold these additional fields.

Let me know how that goes for you.


这篇关于如何显示单个项目的详细信息利用它的详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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