public static int DeleteDatasByVehicleAndTireSize(SqlDbHelper dbHelper, VehicleTireRecommend model) { return(dbHelper.ExecuteNonQuery(@"DELETE Tuhu_productcatalog..tbl_VehicleTireRecommend WHERE VehicleId=@VehicleId AND TireSize=@TireSize", CommandType.Text, new SqlParameter[] { new SqlParameter("@VehicleId", model.Vehicleid), new SqlParameter("@TireSize", model.TireSize) })); }
public static int DeleteDatasByVehiclesAndTireSize(SqlDbHelper dbHelper, VehicleTireRecommend model, string PIDS) { return(dbHelper.ExecuteNonQuery(@"DELETE Tuhu_productcatalog..tbl_VehicleTireRecommend WHERE TireSize=@TireSize AND VehicleId COLLATE Chinese_PRC_CI_AS IN (SELECT * FROM Gungnir..Split(@VehicleIDS,',') AS S) AND PID COLLATE Chinese_PRC_CI_AS IN (SELECT * FROM Gungnir..Split(@PIDS,',') AS SS)", CommandType.Text, new SqlParameter[] { new SqlParameter("@TireSize", model.TireSize), new SqlParameter("@VehicleIDS", string.Join(",", model.VehicleIDS)), new SqlParameter("@PIDS", PIDS) } )); }
public static int InsertDataToRecommend(SqlDbHelper dbHelper, VehicleTireRecommend model, string vehicleid) { return(dbHelper.ExecuteNonQuery(@"INSERT INTO Tuhu_productcatalog..tbl_VehicleTireRecommend(VehicleId,TireSize,PID,Postion,Reason)VALUES(@VehicleId, @TireSize, @PID,@Postion,@Reason)", CommandType.Text, new SqlParameter[] { new SqlParameter("@VehicleId", vehicleid), new SqlParameter("@TireSize", model.TireSize), new SqlParameter("@PID", model.PID), new SqlParameter("@Postion", model.Postion), new SqlParameter("@Reason", string.IsNullOrWhiteSpace(model.Reason)?null:model.Reason) })); }
/// <summary> /// 批量删除 /// </summary> /// <param name="model"></param> /// <param name="Postions"></param> /// <returns></returns> public static int DeleteDatasByPostion(VehicleTireRecommend model, List <int> Postions) { using (var dbHelper = new SqlDbHelper(ConnectionHelper.GetDecryptConn("Gungnir"))) { return(dbHelper.ExecuteNonQuery(@"DELETE Tuhu_productcatalog..tbl_VehicleTireRecommend WHERE TireSize = @TireSize AND VehicleId COLLATE Chinese_PRC_CI_AS IN ( SELECT * FROM Gungnir..Split(@VehicleIDS, ',') AS S ) AND Postion IN ( SELECT * FROM Gungnir..Split(@Postions, ',') AS SS )", CommandType.Text, new SqlParameter[] { new SqlParameter("@TireSize", model.TireSize), new SqlParameter("@VehicleIDS", string.Join(",", model.VehicleIDS)), new SqlParameter("@Postions", string.Join(",", Postions)) } )); } }
public static int DeleteDatasByPostions(VehicleTireRecommend model, List <int> Postions) { return(DALRecommendTire.DeleteDatasByPostion(model, Postions)); }