我想将列表返回到其他类->方法
我在一堂课上有方法
public static List<StatsList> GetAdsStats(string Ticket, DateTime start, DateTime end, int CamId)
{
var client = new CampaignStatsServiceClient();
var id = new CampaignIdFilter();
id.CampaignId = CamId;
var statsdata = new GetAdStatsData();
var kazkas = new Campaign();
kazkas = client.GetAdStats(Ticket, new GetAdStatsData
{
IdFilter = id,
StartDate = start,
EndDate = end
});
int reklamos = kazkas.Ads.Length;
long[] statistikaClikai = new long[reklamos];
long[] statistikaImpresions = new long[reklamos];
List<StatsList> items = new List<StatsList>();
for (int i = 0; i < reklamos; i++)
{
long AllClicks = 0;
long AllImpresions = 0;
int dienos = kazkas.Ads[i].Days.Length;
for (int lop = 0; lop < dienos; lop++)
{
AllClicks = AllClicks + kazkas.Ads[i].Days[lop].Stats.Clicks;
AllImpresions = AllImpresions + kazkas.Ads[i].Days[lop].Stats.Impressions;
}
items.Add(new StatsList() { ID =kazkas.Ads[i].Id, clicks = AllClicks , impresions = AllImpresions });
}
return items;
}
我想将列表返回到其他类->方法并将其显示给网络(列表)
public ActionResult GetStats()
{
int Ids = 141611;
DateTime start = new DateTime(2013, 05, 29);
DateTime end = new DateTime(2013, 06, 17);
GetAdStatsService GetAdStatsService = new GetAdStatsService();
return View();
}
在第一种方法中,我发现一切正常,但在第二种方法中,我不知道如何正确获取列表,请帮助