private QuestEnemyEntity CreateEntity(DataRow row) { QuestEnemyEntity entity = new QuestEnemyEntity(); entity.Id = DaoSupport.GetIntValue(row, "id"); entity.SectionId = DaoSupport.GetIntValue(row, "section_id"); entity.EnemyId = DaoSupport.GetIntValue(row, "enemy_id"); entity.Level = DaoSupport.GetIntValue(row, "level"); return(entity); }
public void Update(QuestEnemyEntity entity, SqliteDatabase mdb = null) { StringBuilder sb = new StringBuilder(); sb.Append("UPDATE quest_enemy SET ") .Append("id = ") .Append(entity.Id) .Append(",") .Append("section_id = ") .Append(entity.SectionId) .Append(",") .Append("enemy_id = ") .Append(entity.EnemyId) .Append(",") .Append("level = ") .Append(entity.Level) .Append(" WHERE id = ") .Append(entity.Id) .Append(";"); if (mdb == null) { DbManager.Instance.ExecuteNonQuery(sb.ToString()); } else { DbManager.Instance.ExecuteNonQuery(sb.ToString(), mdb); } }
public void Insert(QuestEnemyEntity entity, SqliteDatabase mdb = null) { StringBuilder sb = new StringBuilder(); sb.Append("INSERT INTO quest_enemy VALUES (") .Append(entity.Id) .Append(",") .Append(entity.SectionId) .Append(",") .Append(entity.EnemyId) .Append(",") .Append(entity.Level) .Append(");"); if (mdb == null) { DbManager.Instance.ExecuteNonQuery(sb.ToString()); } else { DbManager.Instance.ExecuteNonQuery(sb.ToString(), mdb); } }