如何向生成它的客户提交交易ID [英] How to Entert Transaction Id to Customer for which It was generated

查看:60
本文介绍了如何向生成它的客户提交交易ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发菜单窗口应用程序。



我有一个表格,其中存储了CustomerTable信息。在ADDNewCustomer按钮上,我存储在CustomerTable和customerPendinglist列表框中,并立即打印给客户,因为在shoppe中一次有多个客户,因此我不会立即在那里为DishPackage充值。当急于减少时我会充电。



之后我从互联网上获得交易ID。

然后我从待处理列表中删除客户,那么如何向特定的

客户输入交易ID,以便在输入transactionId后他的充值日期,余额availbale can可以看到。



CustomerTable上没有主键,因为他可以有任意数量的充值



我如何输入客户ID的交易ID,因为该客户已经充值了几个b
的时间。即使我采取不同的ID我知道多少。

解决方案

有一个名为say transaction_customer的新表,其中包含至少2个必填字段:

 transaction_id(主键)
customer_id(主键,客户表customer_id的外键链接)



都是复合键。


hi,

如果我没错,你想在插入过程中每次为客户创建一个交易ID。



 声明  @ transact_ID   nvarchar  10 ); 

set @transact_ID =( select count(*)+ 1 来自 CustomerTable 其中 customer_Id = ' 1'
选择 @ transact_ID

- 此处的插入查询示例
insert into CustomerTable([Cust_id]
,[Cust_name]
,[Transaction_id]

VALUES
1
' 测试'
@ transact_ID





希望这个帮助哟Ú


I am working on dish shoppe windows application.

I have table where CustomerTable information is stored. On ADDNewCustomer button I store in CustomerTable and customerPendinglist listbox and immediately give print to Customer as there are number of customers at a time in shoppe so I don't recharge there DishPackage immediately. When rush is less I do recharge.

After that i get a transaction Id from Internet.
Then I delete customer from the pending list, So How do I enter a transaction Id to a particular
customer, so that after entering transactionId his recharge date ,balance availbale can be seen.

There is no primary key on the CustomerTable because he can have any number of recharge

How do i enter a transaction Id for the customer Id, because that customer has recharged several
time. Even if I take differnt Id How woud i know.

解决方案

Have a new table called say transaction_customer with at least 2 required fields:

transaction_id (primary key)
customer_id (primary key, foreign key link to customer_id of customer table)


both are composite key.


hi,
If iam not wrong you want to create a transaction ID every time for a customer during Insert.

declare @transact_ID nvarchar(10);

set @transact_ID=(select count(*)+1 from CustomerTable  where customer_Id='1')
select @transact_ID

-- Your Insert query here example
insert into CustomerTable   ([Cust_id]
           ,[Cust_name]
           ,[Transaction_id]
           )
     VALUES
           (1
           ,'Test'
           @transact_ID)



Hope this help you.


这篇关于如何向生成它的客户提交交易ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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