private void Validate(ConnectorProductAttributeSetting connectorProductAttributeSetting, Boolean fullCheck = true) { if (connectorProductAttributeSetting == null) { throw new ArgumentNullException("connectorProductAttributeSetting"); } if (fullCheck && connectorProductAttributeSetting.ConnectorProductAttributeID == default(Int32)) { throw new ArgumentException("ConnectorProductAttributeID-property is zero"); } if (fullCheck && connectorProductAttributeSetting.Code == null) { throw new ArgumentException("Code-property is null"); } if (fullCheck && connectorProductAttributeSetting.Type == null) { throw new ArgumentException("Type-property is null"); } if (fullCheck && connectorProductAttributeSetting.Value == null) { throw new ArgumentException("Value-property is null"); } }
public void Delete(ConnectorProductAttributeSetting connectorProductAttributeSetting) { Validate(connectorProductAttributeSetting, false); using (var command = new ConcentratorDatabase.DeleteConnectorProductAttributeSettingCommand(Connection) { ConnectorProductAttributeID = connectorProductAttributeSetting.ConnectorProductAttributeID, Code = connectorProductAttributeSetting.Code }) using (EnsureOpenStatus()) { command.Execute(); } }
public void CreateOrUpdate(ConnectorProductAttributeSetting connectorProductAttributeSetting) { Validate(connectorProductAttributeSetting); using (var command = new ConcentratorDatabase.InsertOrUpdateConnectorProductAttributeSettingCommand(Connection) { ConnectorProductAttributeID = connectorProductAttributeSetting.ConnectorProductAttributeID, Code = connectorProductAttributeSetting.Code, Type = connectorProductAttributeSetting.Type, Value = connectorProductAttributeSetting.Value }) using (EnsureOpenStatus()) { command.Execute(); } }