如何在文本框或标签中生成数字 [英] how to generate number in textbox or label

查看:91
本文介绍了如何在文本框或标签中生成数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

发票编号自动化我每次销售产品后都要进行计算机商店管理,发票编号应该像一个客户的cs102一样自动更改,而另一个客户应该获得cs103的操作方式... i不了解此基础知识,请提供编码或链接,以防万一....不要询问您的编码....我什至不知道一行

Invoice Number Automation i am doing computer shop management each and every time after selling a product the invoice number should change automatically like cs102 for one customer and another customer should get cs103 how to do it........i don''t know basic for this please give coding or link in case you know ....don''t ask show your coding....i don''t know even a single line

推荐答案

您需要将"CSS"部分和数字部分分开-因此将其中一个存储为
字符串形式的昏暗前缀="CS"

并将数字作为整数,
Dim num as Integer = 103

然后,您将发票编号编为

Dim inv as字符串=前缀+ num.ToString()

当然,您可能需要将发票编号存储到某个地方的数据库中,而不是像我一样对e值进行硬编码,但是如果您有机会做自己想做的事,那应该为您提供一个开始.
哦,我差点忘了...那你需要

数值+ = 1

要递减数字部分
You need the ''CSS'' part and the numerical part to be separate - so store one as
Dim prefix as string = "CS"

And the number as an int,
Dim num as Integer = 103

Then you make up your invoice number as

Dim inv as string = prefix + num.ToString()

Of curse you probably need to store the invoice numbers to a db somewhere rather than hard coding e values as I have, but if you''ve any chance of doing what you wish, that should give you a start.

Oh I nearly forgot ... Then you need to

Num += 1

To lincrement the numerical part


首先取最后插入的记录值假定为102.然后将其增加1,然后将其变为103,并创建一个字符串并将值分配给此"cs "+ val.ToString()并在文本框中显示此字符串.每次插入新记录或发票时都要执行此过程.

希望会对您有所帮助.
Hi, First fetch last inserted record value suppose that is 102. then increase this by 1 then it will be 103 and make a string and assign value to this "cs"+val.ToString() and show this string in text box. do this process for each time when you insert a new record or invoice.

Hopefully, it will help you.


此处

http://winform-net.blogspot.in/2011/06/auto-increment-invoice-number-for-vbnet.html [
Here

http://winform-net.blogspot.in/2011/06/auto-increment-invoice-number-for-vbnet.html[^]

is a sample to Auto Increment Invoice Number For Vb.Net, which may be helpful to you

PES


这篇关于如何在文本框或标签中生成数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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