如果账单数量从50不增加,请更改书号 [英] Change book no if bill no increases from 50

查看:80
本文介绍了如果账单数量从50不增加,请更改书号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个文本框.第一个文本框的名称是txtBillno
第二个文本框的名称是txtBookno.
我有一个名为btnSubmit
的按钮

我想要的是:

如果有人在txtBillno中输入最多50的值,然后单击btnSubmit,则txtBookno应该显示1

如果有人在txtBillno中输入介于51到100之间的值,然后单击btnSubmit,则txtBookno应该显示2

如果有人在txtBillno中输入101到150之间的值,然后单击btnSubmit,则txtBookno应该显示3.

等等....
注意:我通过使用if else来做到这一点.所以代码看起来如此大..是任何其他解决方案..

I have two text box. Name of first textbox is txtBillno
Name of second textbox is txtBookno.
and i have a button named btnSubmit


What i want is :

if someone enter value upto 50 in txtBillno and click on btnSubmit then txtBookno should display 1

if someone enter value between 51 to 100 in txtBillno and click on btnSubmit then txtBookno should display 2

if someone enter value between 101 to 150 in txtBillno and click on btnSubmit then txtBookno should display 3.

and so on....
Note :I have done this by using if else. so code looks so big.. is der any other solution..

推荐答案

怎么办:
int displayTxtBookno = (Convert.ToInt32(txtBillno.Text)+49)/50 ; 
txtBookno.Text = displayTxtBookno; 


这篇关于如果账单数量从50不增加,请更改书号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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