1
z8018
2025-03-12 17e4c7e3e7b3ef60d9da6de3b2a39a14a53c38a0
WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Seed/QuartzJobCreateDataTabel.cs
@@ -111,13 +111,21 @@
                                        else
                                            dic[i].Add("CreateDate", DateTime.Now);
                                    }
                                    string str = $"SET IDENTITY_INSERT {t.Name} ON;";
                                    string str = "";
                                    if (DBContext.DbType == SqlSugar.DbType.SqlServer)
                                    {
                                        str += $"SET IDENTITY_INSERT {t.Name} ON;";
                                    str += dbContext.Db.Insertable(dic).AS(t.Name).ToSqlString();
                                        str += dbContext.Db.Insertable(dic).AS(t.Name).ToSqlString();
                                    str += ($"SET IDENTITY_INSERT {t.Name} OFF;");
                                        str += ($"SET IDENTITY_INSERT {t.Name} OFF;");
                                    dbContext.Db.Ado.ExecuteCommand(str);
                                        dbContext.Db.Ado.ExecuteCommand(str);
                                    }
                                    else
                                    {
                                        dbContext.Db.Insertable(dic).AS(t.Name).ExecuteCommand();
                                    }
                                    ConsoleHelper.WriteSuccessLine($"Table [{t.Name}] SeedData Added Successfully");
                                }