public string GetNextId(Db.ConnDb db) { if (ProcessMode == "download" || ProcessMode == "text-pagelist" || ProcessMode == "text-content" || ProcessMode == "text-GetNetfile" || ProcessMode == "text-PostNetfile") { if (maxid == null) { maxid = SrcBeginID; } if (Rows == null || activeindex == Rows.Count) { string sql = Sqltemp.Replace("[maxid]", maxid); DataSet ds = db.query(sql); Rows = ds.Tables[0].Rows; if (Rows.Count == 0) { return(null); } maxid = Rows[Rows.Count - 1][SrcID].ToString(); activeindex = 0; } if (activeindex < 0) { activeindex = 0; } if (activeindex < Rows.Count) { activeindex++; ActiveDatarow = Rows[activeindex - 1]; return(ActiveDatarow[SrcID].ToString()); } } else if (ProcessMode == "text-BeginEndIDNet" || ProcessMode == "BeginEndIDToDb") { if (activeindex < Bid) { activeindex = Bid; } if (activeindex > Eid) { return(null); } activeindex++; return((activeindex - 1).ToString()); } return(null); }
private void SetNewDatabaseFilename(string dbfullname) { this.dbdatafullname = dbfullname; if (!File.Exists(dbfullname)) { Error = true; Msg.Add(dbfullname + "数据库不存在,请重新选择"); return; } if (db != null) { db.connClose(); db = null; } db = new Db.ConnDb(dbfullname); }