protected void CreateLastInfoRecord(int modelId) { M_InfoModel infoModelM = InfoModelBll.GetModel(modelId); //取得对应Id的模板信息 string tableName = infoModelM.TableName; //取得模型的表名 int newRecord = int.Parse(Request.QueryString["newsrecordcount"].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 = CreateBll.LastInfoCount(tableName, newRecord); int pageTotl = 0; 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.GetNewRecordNum(tableName, newRecord, 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(); }