如何找出佣金? [英] how to find out commission?

查看:55
本文介绍了如何找出佣金?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Target(Rs)  Commission
1000-100000      2%
101000-150000   3%
151000-200000   4%
>201000     6%




[文本框] [按钮]
在文本框中接受销售价值,并按照上表显示佣金?
任何人都可以帮助我..i我在google.bt中搜索到了吗?


[100000(在txt框中输入amt)] [显示按钮]
[2000(在文本框的aftr clickin显示按钮中显示值)]




[textbox][button]
Accept the sales value in a text box and display the commission as per the above table??
any one can help me..i searched in google.bt m nt getting?


[100000(entering amt in txt box)][show button]
[2000(showing value in text box aftr clickin show button)]

推荐答案

这闻起来很累,所以我不会给你代码! /> 但是,这一点都不困难:

1)处理按钮Click事件.
2)使用 int.TryParse [ ^ ]方法-记住要向用户报告问题! (我将使用TryParse,以便我检测到错误而不是获取异常).
3)比较该值与底部范围:如果该值大于或等于1000,并且小于或等于100000,则取该值的2%.
4)如果不在上述范围内,请尝试下一个.重复所有范围.
5)如果您仍然找不到它,请报告错误.


您需要做的是使用带有TryParse的IF语句,然后是IF ... THEN ... ELSE IF ... THEN ... ELSE ...构造.

尝试-确实不难!
This smells heavily of homework, so I won''t give you the code!
However, it isn''t difficult at all:

1) Handle the button Click event.
2) Convert the text box value to an integer, using the int.Parse[^] or int.TryParse[^] method - remember to report problems to the user! (I would use TryParse, so that I detect the error rather than getting an exception).
3) Compare the value with your bottom range: if it is greater than or equal to 1000, and less than or equal to 100000, then take 2% of the value.
4) If it isn''t in the range above, try the next. Repeat for all ranges.
5) If you still haven''t found it, report an error.


All you need to do is an IF statement with a TryParse, followed by an IF ... THEN... ELSE IF ... THEN ... ELSE ... construct.

Try it - it really isn''t difficult!


这篇关于如何找出佣金?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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