while (TMs.CompareTo(TMe) < 0)
{
int intdays =0;
if (strTDS == "上旬")
{
intdays = 10;
}
else if (strTDS == "中旬")
{
intdays = 10;
}
else
{
intdays = objDB.GetMonthDays(int.Parse(TMs.Year.ToString()), int.Parse(TMs.Month.ToString()))-20;
}
TMs = TMs.AddDays(intdays);
dblW = GetSKXl(myDT.Rows[i]["STCD"].ToString().Trim(), TMs.ToString(), strXY);
if (dblW != -1)
{
dblSUMW += dblW;
}
if (strTDS == "上旬")
{
strTDS = "中旬";
}
else if (strTDS == "中旬")
{
strTDS = "下旬";
}
else
{
strTDS = "上旬";
}
}
public int GetMonthDays(int intYear,int intMonth)
{
if ((intYear % 400 == 0) || (intYear % 4 == 0 && intYear % 100 != 0))
{
int [] MonthDays ={ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
return MonthDays[intMonth-1];
}
else
{
int [] MonthDays ={ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
return MonthDays[intMonth - 1];
}
}