自动计算 [英] calculate fine automatically

查看:66
本文介绍了自动计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在做一个图书馆管理项目。在前端我有两个文本框,一个用于截止日期,另一个用于详细信息。当在文本框中输入截止日期时,如果截止日期小于当前日期,我希望精细细节也应该在离开焦点后自动显示。

我已经定为罚款1天为5卢比或5美元。它必须计算没有天和应该乘以罚款金额和总数应该显示在精美的文本框中。请任何人帮助我完成这个。



提前谢谢。

解决方案

。它必须计算没有天数,并且应该与精细数量相乘,总数应该显示在精美文本框中。请任何人帮我完成这个。



提前谢谢。


我建​​议你使用JQuery .ajax()方法。创建一个HTTP处理程序,用于计算逾期天数并将其乘以每天的罚款数量并返回结果。在后端计算它的原因是,如果将来需要更改每天的罚款金额,则必须仅在数据库表中更改它。 [ ^ ]是一个非常好的例子。

找到你必须在时间跨度上工作的日期差异

现在你的要求就是当你离开你的文本框时应该显示结果这可以在
上完成
文本框更改事件,此文本框将位于更新面板之间它是一个ajax控件此操作是必要的,因为如果你不打算这样做那么你必须使用按钮来每次显示结果,所以最好使用Ajax控制..



试一试Nd让我知道


Hi every one,
I am doing a library management project.In front end i have two text boxes one for due date and another for fine details.When due date is entered in the text box, if the due date is less than current date i want fine details should also appear automatically after leaving focus.
I have fixed fine for 1 day as 5 Rs or 5$.It has to calculate no of days and should multiply with the fine amount and total should be displayed in the fine text box.Please any one help me in accomplishing this.

Thank you in advance.

解决方案

.It has to calculate no of days and should multiply with the fine amount and total should be displayed in the fine text box.Please any one help me in accomplishing this.

Thank you in advance.


I would suggest you to use JQuery .ajax() method. Create a HTTP handler that calculates the overdue days and multiply it with the amount of fine per day and return the result. The reason for calculating it on the back-end is that if in future you need to change the amount of fine per day, you will have to change it in the database table only. This[^] is a very good example to start.


to find date difference you have to work on time span
now your requirement is when you leave your text box result should be displayed this can be done on
Textbox change event and this textbox will be in between update panel Its a ajax Control This Operation is necessary because if you are not going to do this then you have to use button to display result every time so its better to use Ajax Control..

Try It Nd let me know


这篇关于自动计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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