private static void Clear() { var srv = new ContentApiService(Global.ConnectionString, 1); RegionContentId = Global.GetContentId(DbConnector, RegionContentName); ProductContentId = Global.GetContentId(DbConnector, ProductContentName); if (srv.Exists(ProductContentId)) { srv.Delete(ProductContentId); } if (srv.Exists(RegionContentId)) { srv.Delete(RegionContentId); } }
public static void TearDown() { using (new QPConnectionScope(Global.ConnectionInfo)) { var srv = new ContentApiService(Global.ConnectionInfo, 1); RegionContentId = Global.GetContentId(DbConnector, RegionContentName); ProductContentId = Global.GetContentId(DbConnector, ProductContentName); if (srv.Exists(ProductContentId)) { srv.Delete(ProductContentId); } if (srv.Exists(RegionContentId)) { srv.Delete(RegionContentId); } } }
private static void Clear() { var contentService = new ContentApiService(Global.ConnectionString, 1); var baseContentExists = contentService.Exists(BaseContentId); var dictionaryContentExists = contentService.Exists(DictionaryContentId); var fieldService = new FieldApiService(Global.ConnectionString, 1); if (dictionaryContentExists) { InitDictionaryContentFields(); var dictionaryIds = Global.GetIds(DbConnector, DictionaryContentId); ArticleService.Delete(DictionaryContentId, dictionaryIds); } if (baseContentExists) { InitBaseContentFields(); InitExtensions(); var baseIds = Global.GetIds(DbConnector, BaseContentId); ArticleService.Delete(BaseContentId, baseIds); contentService.Delete(Ex11ContentId); contentService.Delete(Ex12ContentId); contentService.Delete(Ex21ContentId); contentService.Delete(Ex22ContentId); } if (dictionaryContentExists) { fieldService.Delete(DictionaryFieldMtMBackwardId); fieldService.Delete(DictionaryFieldMtOBackwardId); } if (baseContentExists) { fieldService.Delete(BaseFieldMtMId); fieldService.Delete(BaseFieldOtMId); } if (dictionaryContentExists) { contentService.Delete(DictionaryContentId); } if (baseContentExists) { contentService.Delete(BaseContentId); } }