在运行程序时遇到这样一段异常,仔细检查后发现是使用Foreach...In语法体内运用了对Collection的Remove或Add导致的,只需要将foreach方法改为for方法即可。

    for (int i = 0; i < this.prtdeallist.Items.Count; i++)
{
RepeaterItem repeaterItem = this.prtdeallist.Items[i]; if (repeaterItem.ItemType == ListItemType.Item || repeaterItem.ItemType == ListItemType.AlternatingItem)
{
HtmlInputCheckBox cbDealIsSelected = repeaterItem.FindControl("ckPpGuid") as HtmlInputCheckBox;
HiddenField hfDealGuid = repeaterItem.FindControl("HiddenField2") as HiddenField;
if (cbDealIsSelected.Checked )
{
DTDealItemWrapper DealItem = DTDealItemWrapper.FindById(hfDealGuid.Value);
DTDealWrapper DTdeal = null;
if (DealItem == null)
{
DTdeal = DTDealWrapper.FindById(hfDealGuid.Value);
}
if (DealItem != null)
{
DealItem.DDICRMReportStatus = false;
DTDealItemWrapper.Update(DealItem);
string LineCode = "LineCode:" + DealItem.DDILineCode;
RecordDeleteLog(hfDealGuid.Value, LineCode);
}
else if (DTdeal != null)
{
DTdeal.DDCRMReportStatus = false;
DTDealWrapper.Update(DTdeal);
string LineCode = "DD_NO:" + DTdeal.DDNo;
RecordDeleteLog(hfDealGuid.Value, LineCode);
} } }
}

  

最新文章

  1. 【.net 深呼吸】序列化中的“引用保留”
  2. Jquery知识点
  3. J2EE学习路线图
  4. 优雅的数组降维——Javascript中apply方法的妙用
  5. jquery的$().each,$.each的区别
  6. 2015多校.MZL&#39;s endless loop(欧拉回路的机智应用 || 构造)
  7. hdu 4521 小明系列问题——小明序列(线段树 or DP)
  8. linux概念之性能调优
  9. MapReduce shuffle阶段详解
  10. 转载:Source Insight查看ARM汇编源程序 &amp;&amp; 高亮显示程序 &amp;&amp; Source Insight打开project窗口出错
  11. C语言中的volatile
  12. CentOS7 开启关闭网卡
  13. Timus 1180. Stone Game 游戏题目
  14. 【Qt编程】基于Qt的词典开发系列&lt;六&gt;--界面美化设计
  15. 使用Python画玫瑰花
  16. javascript parseUrl函数解析url获取网址url参数
  17. tracert traceroute
  18. UI5-文档-4.2-Bootstrap
  19. Shell脚本之无限循环的两种方法
  20. 创建私有的cocoapod库

热门文章

  1. Oracle数据库零散知识03
  2. NOIP模拟1717 总结
  3. 基于webRTC技术 音频和视频,IM解
  4. matlab、sklearn 中的数据预处理
  5. 十个最有“钱景”的IT技能, 你掌握了哪个?
  6. Arcgis api for javascript学习笔记(3.2X版本)-初步尝试
  7. SQLite从Excel文件中导入数据
  8. Qt 格式转换问题 记录(好多方法)
  9. 如何导入以前的qq聊天记录
  10. Effective JavaScript Item 38 调用父类的构造函数在子类的构造函数