我可以将哪些用于订购系统的界面? [英] What can I use for an interface for an ordering system?

查看:54
本文介绍了我可以将哪些用于订购系统的界面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用VB.NET和MS Access创建订购系统。我在数据库中创建了4个表:tblCustomers,tblProducts,tblOrders和tblOrderDetails。最后一张表是一个订单可以有多个产品。在项目的主页上,我有一个4页的tabControl - 每个表一个,数据网格视图显示每个表的内容。我为客户和产品页面提供了一系列按钮。这些是创建,删除和刷新。 创建按钮将新记录添加到数据库中的相关表。删除按钮从数据库中的表中删除所选记录,刷新只是刷新datagridview。



我遇到的问题是创建订单时。如果系统每个订单只允许一个产品,我只需在订单选项卡上有一个创建按钮,其中新的记录被添加到订单表中,该表由产品选项卡中的所选产品和客户选项卡中的选定客户组成。因为我只能在tabcontrol中选择一行,所以这不适用于允许一个订单中的多个产品。



除了在产品页面上添加某种阵列和添加到订单按钮之外,我想不出的方法是将所选产品添加到阵列中然后在提交时输入表格。还有什么我可以做的吗?



我尝试了什么:



我试过寻找组件,这些组件允许我在datagridview中选择多行但却找不到任何行。

Hi, I am currently creating an ordering system using VB.NET and MS Access. I have created 4 tables in the database: tblCustomers, tblProducts, tblOrders and tblOrderDetails. The last table is so that one order can have multiple products. On the home form of the project, I have a tabControl with 4 pages - one for each table with a datagridview displaying each table's contents. I have a series of buttons for the customers and products pages. These are create, delete and refresh. The create button adds a new record to the relevant table in the database. The delete button deletes the selected record from the table n the database and refresh simply refreshes the datagridview.

The problem I am having is when creating an order. If the system only allowed one product per order, I would simply have a create button on the orders tab where a new record is added to the orders table which consists of the selected product in the products tab and the selected customer in the customers tab. Because I can only select one row in the tabcontrol, this will not work for allowing multiple products in one order.

I cannot think of a way other than having some kind of array and an 'Add to order' button on the products page where the selected product gets added to the array and then entered in the table when submitted. Is there anything else I can do?

What I have tried:

I have tried looking for components that will allow me to select multiple rows in a datagridview but haven't found any.

推荐答案

说实话,标签页对于用户而言,这个想法根本不是自然的 - 听起来像是一个对开发人员来说很容易的用户界面;这是一个非常不同的东西。接口应该围绕用户设计,使其工作尽可能简单和简单(隐藏在幕后的复杂性和实际数据组织,因为它是)



但是在DataGridView上的multisect很简单 - 它甚至默认由MultiSelect属性启用,并按CTRL + Click和SHIFT + Click工作。



但是,对于像这样的应用程序,我这样做的方法是让DataGridView显示所有产品,第二个DGV显示当前的订单进度。只需单击产品,就会在订单中添加一个项目。右键单击,弹出一个对话框,询问您需要多少产品?在它们被添加之前。 (显然,相同的点击系统会从订单DGV中删除项目 - 一次一个或右键单击所有项目。)



它甚至很简单:只需处理MouseClick事件并查看MouseEventArgs.Button以找出按下了哪个按钮。

要查找行,请使用鼠标坐标:

To be honest, the tab page idea doesn't sound at all "natural" to a user - it sounds like a UI that is easy for the developer and that;s a very different thing. Interfaces should be designed around the user and make their job as easy and simple as possible (hiding the complexity and actual data organisation behind the scenes, as it were)

But multisect on a DataGridView is simple - it's even enabled by default by the MultiSelect property and works by CTRL+Click and SHIFT+Click.

However, for an app like this, the way I'd do it is to have a DataGridView to display all products, and a second DGV to show the current order progress. A simple click on the product, and one item is added to the order. A right click, and a dialog pops up to ask "how many of the product do you need?" before they get added as well. (And obviously, the same click system removes items from the Order DGV - one at a time or right click for all.)

It's even pretty simple to do: just handle the MouseClick event and look at the MouseEventArgs.Button to find out which button was pressed.
To find the row, you use the mouse coordinates:
Dim r = myDataGridView.HitTest(e.X, e.Y)

r.RowIndex将为您提供所需的信息。 />


用户完成后,订购按钮将信息传输到数据库。

The r.RowIndex will give you the info you need.

When the user is finished, A "Order" button transfers info to the DB.


这篇关于我可以将哪些用于订购系统的界面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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