Ejemplo n.º 1
0
        private void TryDeleteAllContributions()
        {
            if (Testing)
            {
                return;
            }

            //var db = CMSDataContext.Create(Host);
            if (!JobDbContext.Setting("UploadExcelIpsDeleteGifts"))
            {
                return;
            }

            var deletesql = @"
DELETE dbo.BundleDetail
FROM dbo.BundleDetail d
JOIN dbo.Contribution c ON d.ContributionId = c.ContributionId
DELETE dbo.Contribution
DELETE dbo.BundleHeader
DBCC CHECKIDENT ('[Contribution]', RESEED, 0)
DBCC CHECKIDENT ('[BundleHeader]', RESEED, 0)
DBCC CHECKIDENT ('[BundleDetail]', RESEED, 0)
";

            JobDbContext.ExecuteCommand(deletesql);
        }