public class ReportData
{
public ReportData()
{
}
public ReportDS.ReportDataTable GetPersonReport(DateTime dtBegin, DateTime dtEnd)
{
ReportDS.ReportDataTable rdt = new ReportDS.ReportDataTable();
ReportDS.ZY_CARD_TRADEDataTable cdt;
Person.T_PersonDataTable pdt = new PersonTableAdapters.T_PersonTableAdapter().GetData();
foreach (DataRow pdr in pdt.Rows)
{
cdt = new ReportDSTableAdapters.ZY_CARD_TRADETableAdapter().GetDataByPersonTime(dtBegin, dtEnd, pdr[1].ToString());
DateTime begin = dtBegin;
string content = null;
string cardTime = null;
//int a = 0;
if (begin > dtEnd)
{
break;
}
else
{
cdt = new ReportDSTableAdapters.ZY_CARD_TRADETableAdapter().GetDataByPersonTime(begin, begin.AddDays(1), pdr[1].ToString());
begin = begin.AddDays(1);
if (cdt.Rows.Count == 0)
{
//构建报表dt
DataRow rdr = rdt.NewRow();
rdr[0] = pdr[1].ToString();//卡号
rdr[1] = pdr[2].ToString();//人名
rdr[2] = content;//缺勤
rdr[3] = cardTime;//签到时间
rdr[4] = begin.AddDays(-1).ToShortDateString();//统计时间
rdr[5] = pdr[3].ToString();
rdr[6] = pdr[4].ToString();
rdt.Rows.Add(rdr);
//a = a + 1;
}
}
}
return rdt;
}
}
我想把其中的a传到别的页面中,可是那几种传值的方法我都用过了,传不过去。请高手指点下怎么传怎么接收,先谢谢了。 |