如何使用C#显示每个月的计算值 [英] How to display the computed value for every month using C#

查看:79
本文介绍了如何使用C#显示每个月的计算值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。



我有一个问题,我需要快速解决。



这是一个场景。客户支付的总费用为15,000。现在,客户首先需要首付5000。所以余额是10,000。现在,10,000个将分为10个月,因此客户每个月将支付1,000个。我想显示月份列表以及客户需要支付的款项。我想不出有什么方法可以做到这一点。任何人都可以在这里建议一些链接,可以提供可能在这里帮助我的代码。在此先感谢。

Hi guys.

I have a problem that I need to solve quickly.

Here is the scenario. The total fee to pay by the customer is 15,000. Now, customer needs to down payment of 5,000 at first. So the remaining balance is 10,000. Now, that 10,000 will be divided into 10 months so it the customer will pay 1,000 each month. I want to display the list of months and the payment the customer needs to pay. I cannot think of any way to do this. Can anyone suggest here some links, of can give codes that might help me here. Thanks in advance.

推荐答案

所以你需要了解页面/屏幕应该如何?或者你需要现成的代码吗?



如果您正在寻找第二个,抱歉我无法帮助您,或者说没有人可以提供帮助。



如果是第一个案例,你可以使用第一列作为月份和第二列作为分期付款的网格/列表等的简单表视图。如果您想显示付费分期付款和剩余分期付款,标签视图可能是一个更好的主意(两个标签实际上只显示相同的控件数据将是不同的。
So you need idea how the page /screen should be? or you need ready-made code?

If second is what you are looking for, sorry I can't help you or rather no-one will be able to help.

If the case is first, you can thing of simple table view using grid/list etc having first column as month and second as installment. If you want to show paid installment and remaining installments, a tab view might be a better idea (both tab actually showing same control only data will be different.


一种方法是:您需要一个存储信息的方式例如:



One way is: you need a way to store the info e.g:

class Payment
{
string month;
float amount;
}





他们是一个集合



them a collection such

List<payment>

来保存数据并添加到列表框等



你可以制作一个包含月份名称的枚举或数组,然后



to hold the data and add to Listbox etc.

you can make an enum or array with names of the month, then

float remainder=10000;
int startMonth=1; // change to start month
int numPayments=(int)remainder/12;
float installment=remainder/numPayments;
for(int i=0; i<numpayments;>{
// add new Payment to List
}


这篇关于如何使用C#显示每个月的计算值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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