private void ParseSwitchQty(Prism867Context context, string[] marketFields) { var current = context.Current; if (current == null || current.ModelType != Type867Types.Switch) { throw new InvalidOperationException(); } var header = current as Type867Switch; if (header == null) { throw new InvalidOperationException(); } var model = new Type867SwitchQty { Qualifier = marketFields.AtIndex(2), Uom = marketFields.AtIndex(3), SwitchRead = marketFields.AtIndex(4), MeasurementSignificanceCode = marketFields.AtIndex(5), Message = null }; header.AddQuantity(model); }
public void InsertSwitchQty(Type867SwitchQty model) { using (var connection = new SqlConnection(_connectionString)) using (var command = connection.CreateCommand("csp867SwitchQtyInsert")) { command.AddWithValue("@Switch_Key", model.SwitchKey) .AddIfNotEmptyOrDbNull("@Qualifier", model.Qualifier) .AddIfNotEmptyOrDbNull("@CompositeUOM", model.CompositeUom) .AddIfNotEmptyOrDbNull("@UOM", model.Uom) .AddIfNotEmptyOrDbNull("@SwitchRead", model.SwitchRead) .AddIfNotEmptyOrDbNull("@MeasurementSignificanceCode", model.MeasurementSignificanceCode) .AddIfNotEmptyOrDbNull("@Message", model.Message); if (connection.State != ConnectionState.Open) { connection.Open(); } command.ExecuteNonQuery(); } }
public void InsertSwitchQty(Type867SwitchQty model) { }