public bool UpdateVehicleInfoByPid(string pid, DataTable table, string level, string vehicleLevel)
        {
            var isSuccess = true;

            try
            {
                dbManagerReadOnly.Execute(conn =>
                {
                    var resultList = DalProductVehicleInfo.GetAllProductVehicleTypeConfigInfoByPid(conn, pid, level, vehicleLevel);
                    if (level.Contains("二级"))
                    {
                        for (int i = table.Rows.Count - 1; i >= 0; i--)
                        {
                            var vehicleId = table.Rows[i][1].ToString();
                            //var nian = table.Rows[i][4].ToString();
                            //var paiLiang = table.Rows[i][5].ToString();
                            if (resultList.Exists(item => item.VehicleID == vehicleId))
                            {
                                table.Rows.Remove(table.Rows[i]);//找到重复的就删掉不更新
                                continue;
                            }
                        }
                    }
                    else if (level.Contains("四级"))
                    {
                        for (int i = table.Rows.Count - 1; i >= 0; i--)
                        {
                            var vehicleId = table.Rows[i][1].ToString();
                            var nian      = table.Rows[i][4].ToString();
                            var paiLiang  = table.Rows[i][5].ToString();
                            if (resultList.Exists(item => item.VehicleID == vehicleId && item.Nian == nian && item.PaiLiang == paiLiang))
                            {
                                table.Rows.Remove(table.Rows[i]);
                                continue;
                            }
                        }
                    }
                    else if (level.Contains("五级"))
                    {
                        for (int i = table.Rows.Count - 1; i >= 0; i--)
                        {
                            //var tid = table.Rows[i][6].ToString();
                            var vehicleId = table.Rows[i][1].ToString();
                            var paiLiang  = table.Rows[i][5].ToString();
                            var nian      = table.Rows[i][4].ToString();
                            var salesName = table.Rows[i][7].ToString();
                            if (resultList.Exists(item => item.VehicleID == vehicleId && item.PaiLiang == paiLiang && item.Nian == nian && item.SalesName == salesName))
                            {
                                //如果已存在相同数据则去重
                                table.Rows.Remove(table.Rows[i]);
                                continue;
                            }
                        }
                    }
                    else
                    {
                    }
                    //isSuccess = DalProductVehicleInfo.BulkSaveVehicleInfoByPid(conn, table, level, cpremark);
                });

                Func <SqlConnection, bool> action = (connection) => DalProductVehicleInfo.BulkSaveVehicleInfoByPid(connection, table, level, vehicleLevel);
                dbManager.Execute(action);
            }
            catch (Exception e)
            {
                isSuccess = false;
                Monitor.ExceptionMonitor.AddNewMonitor("编辑页保存车型配置数据异常", e, "保存异常", MonitorLevel.Critial, MonitorModule.Other);
            }

            //try
            //{
            //    //var count = table.Rows.Count;
            //    //先去重,去数据库捞一把防止重复数据插入
            //    if (level.Contains("二级"))
            //    {
            //        Func<SqlConnection, List<ProductVehicleTypeConfigDb>> actionOne = (connection) => DalProductVehicleInfo.GetAllProductVehicleTypeConfigInfoByPid(connection, pid, level, cpremark);
            //        var resultList = dbManager.Execute(actionOne);
            //        try
            //        {
            //            for (int i = table.Rows.Count - 1; i >= 0; i--)
            //            {
            //                var vehicleId = table.Rows[i][1].ToString();
            //                //var nian = table.Rows[i][4].ToString();
            //                //var paiLiang = table.Rows[i][5].ToString();
            //                if (resultList.Exists(item => item.VehicleID == vehicleId))
            //                {
            //                    table.Rows.Remove(table.Rows[i]);//找到重复的就删掉不更新
            //                    //table.Rows[i].Delete();
            //                    continue;
            //                }
            //            }
            //            //table.AcceptChanges();
            //        }
            //        catch (Exception ex)
            //        {
            //            isSuccess = false;
            //        }

            //    }
            //    else if (level.Contains("四级"))
            //    {
            //        Func<SqlConnection, List<ProductVehicleTypeConfigDb>> actionTwo = (connection) => DalProductVehicleInfo.GetAllProductVehicleTypeConfigInfoByPid(connection, pid, level, cpremark);
            //        var resultList = dbManager.Execute(actionTwo);
            //        try
            //        {
            //            for (int i = table.Rows.Count - 1; i >= 0; i--)
            //            {
            //                var vehicleId = table.Rows[i][1].ToString();
            //                var nian = table.Rows[i][4].ToString();
            //                var paiLiang = table.Rows[i][5].ToString();
            //                if (resultList.Exists(item => item.VehicleID == vehicleId && item.Nian == nian && item.PaiLiang == paiLiang))
            //                {
            //                    table.Rows.Remove(table.Rows[i]);
            //                    continue;
            //                }

            //            }
            //        }
            //        catch (Exception ex)
            //        {
            //            isSuccess = false;
            //        }
            //    }
            //    else if (level.Contains("五级"))
            //    {
            //        Func<SqlConnection, List<ProductVehicleTypeConfigDb>> actionThree = (connection) => DalProductVehicleInfo.GetAllProductVehicleTypeConfigInfoByPid(connection, pid, level, cpremark);
            //        var resultList = dbManager.Execute(actionThree);
            //        try
            //        {
            //            for (int i = table.Rows.Count - 1; i >= 0; i--)
            //            {
            //                var tid = table.Rows[i][6].ToString();

            //                if (resultList.Exists(item => item.TID == tid))
            //                {
            //                    //如果已存在相同数据则去重
            //                    table.Rows.Remove(table.Rows[i]);
            //                    continue;
            //                }
            //            }
            //        }
            //        catch (Exception ex)
            //        {
            //            isSuccess = false;
            //        }
            //    }

            //    Func<SqlConnection, bool> action = (connection) => DalProductVehicleInfo.BulkSaveVehicleInfoByPid(connection, table, level, cpremark);
            //    dbManager.Execute(action);
            //}
            //catch (Exception e)
            //{
            //    isSuccess = false;
            //}

            return(isSuccess);
        }