public static bool AddBatteryFastDeliveryProducts(SqlConnection conn, BatteryFastDeliveryProductsModel model) { #region SQL var sql = @"INSERT Configuration..BatteryFastDeliveryProducts ( FastDeliveryId, Brand, ProductPid ) VALUES ( @FastDeliveryId, @Brand, @ProductPid );"; #endregion var parameters = new[] { new SqlParameter("@FastDeliveryId", model.FastDeliveryId), new SqlParameter("@Brand", model.Brand), new SqlParameter("@ProductPid", model.ProductPid) }; var count = SqlHelper.ExecuteNonQuery(conn, CommandType.Text, sql, parameters); return(count > 0); }
public static bool DeleteBatteryFastDeliveryProducts(SqlConnection conn, BatteryFastDeliveryProductsModel model) { #region SQL var sql = @"DELETE Configuration..BatteryFastDeliveryProducts WHERE FastDeliveryId = @FastDeliveryId AND ProductPid = @ProductPid AND Brand = @Brand;"; #endregion var parameters = new[] { new SqlParameter("@FastDeliveryId", model.FastDeliveryId), new SqlParameter("@ProductPid", model.ProductPid), new SqlParameter("@Brand", model.Brand) }; var count = SqlHelper.ExecuteNonQuery(conn, CommandType.Text, sql, parameters); return(count > 0); }