我正在尝试在收益返回后执行代码。我有调用另一种方法的WebMethod,我想在将值返回给WebMethod(执行方法setNextCampaign())后做一些工作这是我的代码:
[WebMethod]
public long NextCall(long UserID)
{
CampaignManagerExtended cacheCampaignManager = fillCampaignManager(false);
return cacheCampaignManager.NextCall(UserID).First();
}
public IEnumerable<long> NextCall(long UserID)
{
UserExtended ue = null;
try
{
if (!CacheUsers.ContainsKey(UserID))
AddUser(UserID);
ue = CacheUsers.First(p => p.Key == UserID).Value;
if (ue.NextCampaign != null)
{
QueueItemPersonal qp = ue.NextFromPersonalQueue();
if (qp != null)
{
yield return qp.CampaignPersonID;
}
else
{
QueueItemScheduled qs = ue.NextCampaign.NextFromScheduleQueue();
if (qs != null)
{
yield return qs.CampaignPersonID;
}
else
{
QueueItemGeneral qg = ue.NextCampaign.NextFromGeneralQueue();
if (qg != null)
{
yield return qg.CampaignPersonID;
}
else
yield return 0;
}
}
ue.NextCampaign.fillGeneralQueue();
ue.setNextCampaign();
}
else
yield return 0;
}
//catch
//{
// yield return 0;
//}
finally
{
}
}
有任何想法吗?