protected void CreateInfoId(int modelIdNum) { M_InfoModel infoModelM = InfoModelBll.GetModel(modelIdNum); //取得对应Id的模板信息 string tableName = infoModelM.TableName; //取得模型的表名 int startId = int.Parse(Request.QueryString["startid"].ToString()); int endId = int.Parse(Request.QueryString["endid"].ToString()); B_Create CreateBll = new B_Create(); B_SiteInfo bllSite = new B_SiteInfo(); M_InfoSite mInfoSite = bllSite.GetInfoModel(); int pageSize = mInfoSite.InfoCreateNum; int pageIndex = 1; int recordCount = 0; int pageTotl = 0; string wheStr = " and i.id in(select id from " + tableName + " where id>=" + startId + " and id<=" + endId + ") "; CreateBll.InfoRecordCount(tableName, wheStr, ref recordCount); pageTotl = (recordCount - 1) / pageSize + 1; Response.Write("<script>SetTotal(" + recordCount + ")</script>\r\n"); Response.Flush(); string currentPer = "0.0"; for (int crti = 1; crti <= pageTotl; crti++) { pageIndex = crti; DataTable dt = CreateBll.GetIdRange(tableName, startId, endId, pageIndex, pageSize); for (int i = 1; i <= dt.Rows.Count; i++) { int currIndex = pageSize * (crti - 1) + i; string per = ((double)currIndex * 100 / (double)recordCount).ToString("F1"); CreateBll.CreateInfo(dt.Rows[i - 1]); if (currentPer != per) { currentPer = per; Response.Write("<script>SetPr('" + per + "%'," + currIndex + ")</script>\r\n"); Response.Flush(); } } dt.Dispose(); } Response.Write("<script>SetPr('100.0%'," + recordCount + ")</script>"); Response.Write("<script>document.getElementById('finallytd').innerText = '生成完毕'</script>"); Response.Flush(); CreateBll.ClearHashTable(); }