|
![](/images/resource/spacer.gif) |
|
generate เดือนไม่ขึ้นช่วยดูโค้ดกับรูปที่แนบมาให้ทีครับ |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
Code
public static DateTime NextM(DateTime dateT)
{
if (dateT.Day != DateTime.DaysInMonth(dateT.Year, dateT.Month))
{
dateT = dateT.AddMonths(1);
return new DateTime(dateT.Year, dateT.Month, DateTime.DaysInMonth(dateT.Year, dateT.Month));
}
else
{
dateT = dateT.AddDays(1).AddMonths(1).AddDays(-1);
return new DateTime(dateT.Year, dateT.Month, DateTime.DaysInMonth(dateT.Year, dateT.Month));
}
}
public void GenTable()
{
string STARTPAY_PERIOD = dsMain.DATA[0].STARTPAY_PERIOD;
decimal PERIOD_INSTALLMENT = dsMain.DATA[0].PERIOD_INSTALLMENT;
decimal PRINCIPAL_BALANCE = dsMain.DATA[0].PRINCIPAL_BALANCE;
decimal PERIOD_PAYMENT = dsMain.DATA[0].PERIOD_PAYMENT;
decimal CONTINT_RATE = dsMain.DATA[0].CONTINT_RATE;
decimal INT_RATE = (CONTINT_RATE / 100);
decimal prnpay_amt = 0;
decimal intpay_amt = 0;
int intday = 0;
DateTime dateT = DateTime.ParseExact(STARTPAY_PERIOD, "yyyyMM", WebUtil.TH);
dateT = new DateTime(dateT.Year, dateT.Month, DateTime.DaysInMonth(dateT.Year, dateT.Month));
decimal an_year = dsMain.DATA[0].an_year;
![หน้าจอ หน้าจอ](https://www.thaicreate.com/upload/stock/20160620104750.jpg?v=1001)
ผลออกมาดังรูปไม่สามารถ generate วันที่ออกมาได้กลายเป็น 00/00/0000 ไม่ทราบว่าโค้ดที่ลงไว้ถูกหรือเปล่ารบกวนช่วยตรวจสอบให้ทีครับ
Tag : .NET, VB.NET, C#
![](/images/adv.jpg?v=1001)
|
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2016-06-20 11:15:49 |
By :
baajack |
View :
750 |
Reply :
3 |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ใช้ String.Format({0:dd/MM/yyyy},datetime);
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2016-06-20 13:13:25 |
By :
bigsuntat |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ใส่อันที่แสดงผล ครับ ครอบมันอีกทีด้วย String.Format
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2016-06-21 17:29:08 |
By :
bigsuntat |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 04
|