110,533
社区成员
发帖
与我相关
我的任务
分享
if (IsSucceedList.Count > 0)
{bool needBroken=false;
//遍历集合,如果为true继续遍历,如果为false将数据更新为初始状态并停止遍历。
foreach (bool success in IsSucceedList)
{
if (success)
{
IsSucced = true;
}
else
{
IsSucced = false;
if (UpdateQntyDt != null && UpdateQntyDt.Rows.Count > 0)
{
for (int i = 0; i < UpdateQntyDt.Rows.Count; i++)
{
。。。。。。
}
}
//此处想跳出整个循环用break可行吗?
needBroken=true;break;
}
}
if(!needBroken)
{
//执行不需要结束的代码
}
}
}
goto虽然我上面也写了,但慎用