我第一次创建付款期间计划,其类型为每月,例如,开始,结束,交易和支付期间的功能如下所示:
以上是第一个月的工资期。下个月它会自动创建这样的并插入数据库我做什么?
请帮帮我..
答案 0 :(得分:0)
for (int i = 1; i <= 12; ++i)
{
DateTime firstDate = new DateTime(2012, i, 1, 0, 0, 0);
int daysInMonth = DateTime.DaysInMonth(2012, i);
DateTime endDate = new DateTime(2012, i, daysInMonth-1, 23, 59, 59);
DateTime TransactionDate = new DateTime(2012, i, daysInMonth, 0, 0, 0);
Console.WriteLine(firstDate.ToString() +
"," + endDate.ToString() +
"," + TransactionDate.ToString());
}