public int Insert(ScoreRequirementItem item) { string query = "Insert into ScoreRequirement(accountId,cutline) VALUES(@AccountId, @Cutline)"; IDbParameters param = CreateDbParameters(); param.AddWithValue("AccountId", item.AccountId).DbType = DbType.Int32; param.AddWithValue("Cutline", item.Cutline).DbType = DbType.Int32; return(AdoTemplate.ExecuteNonQuery(CommandType.Text, query, param)); }
public int Update(ScoreRequirementItem item) { string query = "UPDATE ScoreRequirement SET accountId = @AccountId, cutline=@Cutline where id = @Id"; IDbParameters param = CreateDbParameters(); param.AddWithValue("Id", item.Id).DbType = DbType.Int32; param.AddWithValue("AccountId", item.AccountId).DbType = DbType.Int32; param.AddWithValue("Cutline", item.Cutline).DbType = DbType.Int32; return(AdoTemplate.ExecuteNonQuery(CommandType.Text, query, param)); }