本文介绍了如何显示贷款期限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,先生,
我想在gridview中显示贷款期限条目,我的意思是假设我有36个月的贷款,每月EMI为20000,我的贷款开始从2013年8月到2015年8月,所有条目必须在gridview中显示如
输出:
hello sir,
I want show loan tenure entries in gridview, i mean suppose i have loan for 36 month and EMI per month is 20000 and my loan starts from Aug 2013 To Aug 2015, so all entries must show in gridview like
Output:
EMIPerMonth | Month | Year
20000 Aug 2013
20000 Sep 2013
till
20000 Aug 2015
推荐答案
DateTime startdate = new DateTime(2013, 8, 1);
DateTime enddate = startdate.AddMonths(35);
DateTime currdate =startdate;
while (currdate <=enddate)
{
Console.WriteLine("MonthNo: {0}, MonthName: {1}, Year: {2}", currdate.Month.ToString(), currdate.ToString("MMMM"), currdate.Year.ToString());
currdate = currdate.AddMonths(1) ;
}
Console.ReadKey();
这篇关于如何显示贷款期限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!