// Maps the dynamic result private static MspWorklogTariffType MapWorklogTariffType(dynamic res) { var type = new MspWorklogTariffType(res.picklistid, res.value); if (type.Description.Contains("Removed")) { type.IsRemoved = true; } return(type); }
/// <inheritdoc /> public void Add(MspWorklogTariffType worklogTariffType) { const string query = "INSERT INTO udf_picklistvalues(picklistid, tablename, columname, value) " + "VALUES (nextval('picklist_id_seq'), 'WorkLog_Fields', 'UDF_CHAR2', @Desc) RETURNING picklistid"; var param = new { Desc = worklogTariffType.Description }; worklogTariffType.Id = Connection.ExecuteScalar <long>(query, param, Transaction); }
/// <inheritdoc /> public void Remove(MspWorklogTariffType worklogTariffType) { const string query = "UPDATE udf_picklistvalues" + "SET value = @Desc " + "WHERE picklistid = @Id"; var param = new { Desc = $"Removed - {worklogTariffType.Description}", Id = worklogTariffType.Id, }; worklogTariffType.Id = Connection.ExecuteScalar <long>(query, param, Transaction); }